OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <errno.h> | 5 #include <errno.h> |
6 #include <signal.h> | 6 #include <signal.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <sys/file.h> | 8 #include <sys/file.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 | 10 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 int main(int argc, char** argv) { | 154 int main(int argc, char** argv) { |
155 unsigned int i = 0; | 155 unsigned int i = 0; |
156 bool wait_for_iface = false; | 156 bool wait_for_iface = false; |
157 int pidfile_fd; | 157 int pidfile_fd; |
158 | 158 |
159 signal(SIGPIPE, SIG_IGN); | 159 signal(SIGPIPE, SIG_IGN); |
160 signal(SIGTERM, SignalHandler); | 160 signal(SIGTERM, SignalHandler); |
161 signal(SIGINT, SignalHandler); | 161 signal(SIGINT, SignalHandler); |
162 signal(SIGHUP, SignalHandler); | 162 signal(SIGHUP, SignalHandler); |
163 | 163 |
164 CommandLine::Init(argc, argv); | 164 base::CommandLine::Init(argc, argv); |
165 CommandLine cl(argc, argv); | 165 base::CommandLine cl(argc, argv); |
166 | 166 |
167 if (cl.HasSwitch("help") || argc < 2) { | 167 if (cl.HasSwitch("help") || argc < 2) { |
168 printf("%s <options>\n", argv[0]); | 168 printf("%s <options>\n", argv[0]); |
169 printf(" Proxy options:\n"); | 169 printf(" Proxy options:\n"); |
170 printf( | 170 printf( |
171 "\t--proxy<1..n>=\"<listen ip>,<listen port>," | 171 "\t--proxy<1..n>=\"<listen ip>,<listen port>," |
172 "<ssl cert filename>,\n" | 172 "<ssl cert filename>,\n" |
173 "\t <ssl key filename>,<http server ip>," | 173 "\t <ssl key filename>,<http server ip>," |
174 "<http server port>,\n" | 174 "<http server port>,\n" |
175 "\t [https server ip],[https server port]," | 175 "\t [https server ip],[https server port]," |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 } | 413 } |
414 break; | 414 break; |
415 } | 415 } |
416 usleep(1000 * 10); // 10 ms | 416 usleep(1000 * 10); // 10 ms |
417 } | 417 } |
418 | 418 |
419 unlink(PIDFILE); | 419 unlink(PIDFILE); |
420 close(pidfile_fd); | 420 close(pidfile_fd); |
421 return 0; | 421 return 0; |
422 } | 422 } |
OLD | NEW |