summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/test_server.cc
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-05 11:32:40 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-05 11:32:40 +0000
commit0569d86c57dd9385556e4ab4792e74d552c9df59 (patch)
treeb197fd2a9f1296b7ba49601ba0f31b3ba540de1a /chrome_frame/test/test_server.cc
parentca311ce0f5002da40625bf87a24858d294d1d1bc (diff)
downloadchromium_src-0569d86c57dd9385556e4ab4792e74d552c9df59.zip
chromium_src-0569d86c57dd9385556e4ab4792e74d552c9df59.tar.gz
chromium_src-0569d86c57dd9385556e4ab4792e74d552c9df59.tar.bz2
Brushed up listen socket:
- Upstreamed support for partial results from devtools' version - Made DidRead receive data and length (in order to support websockets data) - Fixed all the clients. Added net/server with http socket implementation that supports websockets. Will remove net/tools fetch client and server later. Review URL: http://codereview.chromium.org/2868036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51635 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/test_server.cc')
-rw-r--r--chrome_frame/test/test_server.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome_frame/test/test_server.cc b/chrome_frame/test/test_server.cc
index 942333a..88672b8 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_);