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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 NULL); | 328 NULL); |
329 } | 329 } |
330 | 330 |
331 // Spdy Server Acceptor | 331 // Spdy Server Acceptor |
332 net::MemoryCache spdy_memory_cache; | 332 net::MemoryCache spdy_memory_cache; |
333 if (cl.HasSwitch("spdy-server")) { | 333 if (cl.HasSwitch("spdy-server")) { |
334 spdy_memory_cache.AddFiles(); | 334 spdy_memory_cache.AddFiles(); |
335 std::string value = cl.GetSwitchValueASCII("spdy-server"); | 335 std::string value = cl.GetSwitchValueASCII("spdy-server"); |
336 std::vector<std::string> valueArgs = split(value, ','); | 336 std::vector<std::string> valueArgs = split(value, ','); |
337 while (valueArgs.size() < 4) | 337 while (valueArgs.size() < 4) |
338 valueArgs.push_back(""); | 338 valueArgs.push_back(std::string()); |
339 g_proxy_config.AddAcceptor(net::FLIP_HANDLER_SPDY_SERVER, | 339 g_proxy_config.AddAcceptor(net::FLIP_HANDLER_SPDY_SERVER, |
340 valueArgs[0], valueArgs[1], | 340 valueArgs[0], |
341 valueArgs[2], valueArgs[3], | 341 valueArgs[1], |
342 "", "", "", "", | 342 valueArgs[2], |
| 343 valueArgs[3], |
| 344 std::string(), |
| 345 std::string(), |
| 346 std::string(), |
| 347 std::string(), |
343 0, | 348 0, |
344 FLAGS_accept_backlog_size, | 349 FLAGS_accept_backlog_size, |
345 FLAGS_disable_nagle, | 350 FLAGS_disable_nagle, |
346 FLAGS_accepts_per_wake, | 351 FLAGS_accepts_per_wake, |
347 FLAGS_reuseport, | 352 FLAGS_reuseport, |
348 wait_for_iface, | 353 wait_for_iface, |
349 &spdy_memory_cache); | 354 &spdy_memory_cache); |
350 } | 355 } |
351 | 356 |
352 // Spdy Server Acceptor | 357 // Spdy Server Acceptor |
353 net::MemoryCache http_memory_cache; | 358 net::MemoryCache http_memory_cache; |
354 if (cl.HasSwitch("http-server")) { | 359 if (cl.HasSwitch("http-server")) { |
355 http_memory_cache.AddFiles(); | 360 http_memory_cache.AddFiles(); |
356 std::string value = cl.GetSwitchValueASCII("http-server"); | 361 std::string value = cl.GetSwitchValueASCII("http-server"); |
357 std::vector<std::string> valueArgs = split(value, ','); | 362 std::vector<std::string> valueArgs = split(value, ','); |
358 while (valueArgs.size() < 4) | 363 while (valueArgs.size() < 4) |
359 valueArgs.push_back(""); | 364 valueArgs.push_back(std::string()); |
360 g_proxy_config.AddAcceptor(net::FLIP_HANDLER_HTTP_SERVER, | 365 g_proxy_config.AddAcceptor(net::FLIP_HANDLER_HTTP_SERVER, |
361 valueArgs[0], valueArgs[1], | 366 valueArgs[0], |
362 valueArgs[2], valueArgs[3], | 367 valueArgs[1], |
363 "", "", "", "", | 368 valueArgs[2], |
| 369 valueArgs[3], |
| 370 std::string(), |
| 371 std::string(), |
| 372 std::string(), |
| 373 std::string(), |
364 0, | 374 0, |
365 FLAGS_accept_backlog_size, | 375 FLAGS_accept_backlog_size, |
366 FLAGS_disable_nagle, | 376 FLAGS_disable_nagle, |
367 FLAGS_accepts_per_wake, | 377 FLAGS_accepts_per_wake, |
368 FLAGS_reuseport, | 378 FLAGS_reuseport, |
369 wait_for_iface, | 379 wait_for_iface, |
370 &http_memory_cache); | 380 &http_memory_cache); |
371 } | 381 } |
372 | 382 |
373 std::vector<net::SMAcceptorThread*> sm_worker_threads_; | 383 std::vector<net::SMAcceptorThread*> sm_worker_threads_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 break; | 418 break; |
409 } | 419 } |
410 usleep(1000*10); // 10 ms | 420 usleep(1000*10); // 10 ms |
411 } | 421 } |
412 | 422 |
413 unlink(PIDFILE); | 423 unlink(PIDFILE); |
414 close(pidfile_fd); | 424 close(pidfile_fd); |
415 return 0; | 425 return 0; |
416 } | 426 } |
417 | 427 |
OLD | NEW |