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

Unified Diff: chrome_frame/test/test_server.cc

Issue 2868036: Brushed up listen socket: (Closed)
Patch Set: Lint. Created 10 years, 5 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 | « chrome_frame/test/test_server.h ('k') | net/base/listen_socket.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/test_server.cc
diff --git a/chrome_frame/test/test_server.cc b/chrome_frame/test/test_server.cc
index 942333a7e8f2bf09b1a66589be7c9cf9fa47813b..88672b8a93276b7996b7c24c2493fc88e9c10a87 100644
--- a/chrome_frame/test/test_server.cc
+++ b/chrome_frame/test/test_server.cc
@@ -172,11 +172,13 @@ void SimpleWebServer::DidAccept(ListenSocket* server,
}
void SimpleWebServer::DidRead(ListenSocket* connection,
- const std::string& data) {
+ const char* data,
+ int len) {
Connection* c = FindConnection(connection);
DCHECK(c);
Request& r = c->request();
- r.OnDataReceived(data);
+ std::string str(data, len);
+ r.OnDataReceived(str);
if (r.AllContentReceived()) {
const Request& request = c->request();
Response* response = FindResponse(request);
@@ -247,11 +249,14 @@ void HTTPTestServer::DidAccept(ListenSocket* server, ListenSocket* socket) {
connection_list_.push_back(new ConfigurableConnection(socket));
}
-void HTTPTestServer::DidRead(ListenSocket* socket, const std::string& data) {
+void HTTPTestServer::DidRead(ListenSocket* socket,
+ const char* data,
+ int len) {
scoped_refptr<ConfigurableConnection> connection =
ConnectionFromSocket(socket);
if (connection) {
- connection->r_.OnDataReceived(data);
+ std::string str(data, len);
+ connection->r_.OnDataReceived(str);
if (connection->r_.AllContentReceived()) {
if (LowerCaseEqualsASCII(connection->r_.method(), "post"))
this->Post(connection, connection->r_.path(), connection->r_);
« no previous file with comments | « chrome_frame/test/test_server.h ('k') | net/base/listen_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698