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 <sys/file.h> | 7 #include <sys/file.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 | 9 |
10 #include <iostream> | 10 #include <iostream> |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 268 |
269 if (cl.HasSwitch("force_spdy")) | 269 if (cl.HasSwitch("force_spdy")) |
270 net::SMConnection::set_force_spdy(true); | 270 net::SMConnection::set_force_spdy(true); |
271 | 271 |
272 logging::LoggingSettings settings; | 272 logging::LoggingSettings settings; |
273 settings.logging_dest = g_proxy_config.log_destination_; | 273 settings.logging_dest = g_proxy_config.log_destination_; |
274 settings.log_file = g_proxy_config.log_filename_.c_str(); | 274 settings.log_file = g_proxy_config.log_filename_.c_str(); |
275 settings.lock_log = logging::DONT_LOCK_LOG_FILE; | 275 settings.lock_log = logging::DONT_LOCK_LOG_FILE; |
276 logging::InitLogging(settings); | 276 logging::InitLogging(settings); |
277 | 277 |
278 LOG(INFO) << "Flip SPDY proxy started with configuration:"; | 278 VLOG(0) << "Flip SPDY proxy started with configuration:"; |
279 LOG(INFO) << "Logging destination : " << g_proxy_config.log_destination_; | 279 VLOG(0) << "Logging destination : " << g_proxy_config.log_destination_; |
280 LOG(INFO) << "Log file : " << g_proxy_config.log_filename_; | 280 VLOG(0) << "Log file : " << g_proxy_config.log_filename_; |
281 LOG(INFO) << "Forward IP Header : " | 281 VLOG(0) << "Forward IP Header : " |
282 << (net::SpdySM::forward_ip_header().length() ? | 282 << (net::SpdySM::forward_ip_header().length() ? |
283 net::SpdySM::forward_ip_header() : "<disabled>"); | 283 net::SpdySM::forward_ip_header() : "<disabled>"); |
284 LOG(INFO) << "Wait for interfaces : " << (wait_for_iface?"true":"false"); | 284 VLOG(0) << "Wait for interfaces : " << (wait_for_iface?"true":"false"); |
285 LOG(INFO) << "Accept backlog size : " << FLAGS_accept_backlog_size; | 285 VLOG(0) << "Accept backlog size : " << FLAGS_accept_backlog_size; |
286 LOG(INFO) << "Accepts per wake : " << FLAGS_accepts_per_wake; | 286 VLOG(0) << "Accepts per wake : " << FLAGS_accepts_per_wake; |
287 LOG(INFO) << "Disable nagle : " | 287 VLOG(0) << "Disable nagle : " |
288 << (FLAGS_disable_nagle?"true":"false"); | 288 << (FLAGS_disable_nagle?"true":"false"); |
289 LOG(INFO) << "Reuseport : " | 289 VLOG(0) << "Reuseport : " |
290 << (FLAGS_reuseport?"true":"false"); | 290 << (FLAGS_reuseport?"true":"false"); |
291 LOG(INFO) << "Force SPDY : " | 291 VLOG(0) << "Force SPDY : " |
292 << (FLAGS_force_spdy?"true":"false"); | 292 << (FLAGS_force_spdy?"true":"false"); |
293 LOG(INFO) << "SSL session expiry : " | 293 VLOG(0) << "SSL session expiry : " |
294 << g_proxy_config.ssl_session_expiry_; | 294 << g_proxy_config.ssl_session_expiry_; |
295 LOG(INFO) << "SSL disable compression : " | 295 VLOG(0) << "SSL disable compression : " |
296 << g_proxy_config.ssl_disable_compression_; | 296 << g_proxy_config.ssl_disable_compression_; |
297 LOG(INFO) << "Connection idle timeout : " | 297 VLOG(0) << "Connection idle timeout : " |
298 << g_proxy_config.idle_socket_timeout_s_; | 298 << g_proxy_config.idle_socket_timeout_s_; |
299 | 299 |
300 // Proxy Acceptors | 300 // Proxy Acceptors |
301 while (true) { | 301 while (true) { |
302 i += 1; | 302 i += 1; |
303 std::stringstream name; | 303 std::stringstream name; |
304 name << "proxy" << i; | 304 name << "proxy" << i; |
305 if (!cl.HasSwitch(name.str())) { | 305 if (!cl.HasSwitch(name.str())) { |
306 break; | 306 break; |
307 } | 307 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } | 414 } |
415 break; | 415 break; |
416 } | 416 } |
417 usleep(1000*10); // 10 ms | 417 usleep(1000*10); // 10 ms |
418 } | 418 } |
419 | 419 |
420 unlink(PIDFILE); | 420 unlink(PIDFILE); |
421 close(pidfile_fd); | 421 close(pidfile_fd); |
422 return 0; | 422 return 0; |
423 } | 423 } |
OLD | NEW |