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

Side by Side Diff: chrome/test/chromedriver/server/chromedriver_server.cc

Issue 590653002: [chromedriver] Remove extra call to HttpServer::Close() and increase TestHttpServer buffer limit (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 unified diff | Download patch
« no previous file with comments | « chrome/test/chromedriver/net/test_http_server.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stdio.h> 5 #include <stdio.h>
6 #include <locale> 6 #include <locale>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/at_exit.h" 10 #include "base/at_exit.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 virtual void OnClose(int connection_id) OVERRIDE {} 80 virtual void OnClose(int connection_id) OVERRIDE {}
81 81
82 private: 82 private:
83 void OnResponse(int connection_id, 83 void OnResponse(int connection_id,
84 scoped_ptr<net::HttpServerResponseInfo> response) { 84 scoped_ptr<net::HttpServerResponseInfo> response) {
85 // Don't support keep-alive, since there's no way to detect if the 85 // Don't support keep-alive, since there's no way to detect if the
86 // client is HTTP/1.0. In such cases, the client may hang waiting for 86 // client is HTTP/1.0. In such cases, the client may hang waiting for
87 // the connection to close (e.g., python 2.7 urllib). 87 // the connection to close (e.g., python 2.7 urllib).
88 response->AddHeader("Connection", "close"); 88 response->AddHeader("Connection", "close");
89 server_->SendResponse(connection_id, *response); 89 server_->SendResponse(connection_id, *response);
90 server_->Close(connection_id);
stgao 2014/09/20 02:10:04 Why we don't have to close the connection now? Is
91 } 90 }
92 91
93 HttpRequestHandlerFunc handle_request_func_; 92 HttpRequestHandlerFunc handle_request_func_;
94 scoped_ptr<net::HttpServer> server_; 93 scoped_ptr<net::HttpServer> server_;
95 base::WeakPtrFactory<HttpServer> weak_factory_; // Should be last. 94 base::WeakPtrFactory<HttpServer> weak_factory_; // Should be last.
96 }; 95 };
97 96
98 void SendResponseOnCmdThread( 97 void SendResponseOnCmdThread(
99 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, 98 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
100 const HttpResponseSenderFunc& send_response_on_io_func, 99 const HttpResponseSenderFunc& send_response_on_io_func,
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 301 }
303 302
304 if (!InitLogging()) { 303 if (!InitLogging()) {
305 printf("Unable to initialize logging. Exiting...\n"); 304 printf("Unable to initialize logging. Exiting...\n");
306 return 1; 305 return 1;
307 } 306 }
308 RunServer(port, allow_remote, whitelisted_ips, 307 RunServer(port, allow_remote, whitelisted_ips,
309 url_base, adb_port, port_server.Pass()); 308 url_base, adb_port, port_server.Pass());
310 return 0; 309 return 0;
311 } 310 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/net/test_http_server.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698