Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: cloud_print/gcp20/prototype/privet_http_server.cc

Issue 598433002: Added --disable-ipv4 and --disable-ipv6 switches. By default both enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cloud_print/gcp20/prototype/printer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cloud_print/gcp20/prototype/privet_http_server.cc
diff --git a/cloud_print/gcp20/prototype/privet_http_server.cc b/cloud_print/gcp20/prototype/privet_http_server.cc
index 8dfa0cc3a7cc75b423d4ecd47bbb1b7639a1a158..5b4086fbed6020d8857f233f10a8448a1b94274f 100644
--- a/cloud_print/gcp20/prototype/privet_http_server.cc
+++ b/cloud_print/gcp20/prototype/privet_http_server.cc
@@ -108,7 +108,10 @@ bool PrivetHttpServer::Start(uint16 port) {
scoped_ptr<net::ServerSocket> server_socket(
new net::TCPServerSocket(NULL, net::NetLog::Source()));
- server_socket->ListenWithAddressAndPort("0.0.0.0", port, 1);
+ std::string listen_address = "::";
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableIpv6))
+ listen_address = "0.0.0.0";
+ server_socket->ListenWithAddressAndPort(listen_address, port, 1);
server_.reset(new net::HttpServer(server_socket.Pass(), this));
net::IPEndPoint address;
« no previous file with comments | « cloud_print/gcp20/prototype/printer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698