| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifdef _WIN32 | 5 #ifdef _WIN32 |
| 6 #include <winsock2.h> | 6 #include <winsock2.h> |
| 7 #else | 7 #else |
| 8 #include <arpa/inet.h> | 8 #include <arpa/inet.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 return false; | 303 return false; |
| 304 case ST_ERR: | 304 case ST_ERR: |
| 305 return false; | 305 return false; |
| 306 } | 306 } |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 // No more characters, but we haven't finished parsing yet. | 309 // No more characters, but we haven't finished parsing yet. |
| 310 return false; | 310 return false; |
| 311 } | 311 } |
| 312 | 312 |
| 313 void HttpListenSocket::Close() { |
| 314 ListenSocket::Close(); |
| 315 } |
| 316 |
| 317 void HttpListenSocket::Listen() { |
| 318 ListenSocket::Listen(); |
| 319 } |
| 320 |
| 313 void HttpListenSocket::DidAccept(ListenSocket* server, | 321 void HttpListenSocket::DidAccept(ListenSocket* server, |
| 314 ListenSocket* connection) { | 322 ListenSocket* connection) { |
| 315 connection->AddRef(); | 323 connection->AddRef(); |
| 316 } | 324 } |
| 317 | 325 |
| 318 void HttpListenSocket::DidRead(ListenSocket*, | 326 void HttpListenSocket::DidRead(ListenSocket*, |
| 319 const char* data, | 327 const char* data, |
| 320 int len) { | 328 int len) { |
| 321 recv_data_.append(data, len); | 329 recv_data_.append(data, len); |
| 322 while (recv_data_.length()) { | 330 while (recv_data_.length()) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 340 } | 348 } |
| 341 } | 349 } |
| 342 delegate_->OnHttpRequest(this, request); | 350 delegate_->OnHttpRequest(this, request); |
| 343 } | 351 } |
| 344 } | 352 } |
| 345 | 353 |
| 346 void HttpListenSocket::DidClose(ListenSocket* sock) { | 354 void HttpListenSocket::DidClose(ListenSocket* sock) { |
| 347 sock->Release(); | 355 sock->Release(); |
| 348 delegate_->OnClose(this); | 356 delegate_->OnClose(this); |
| 349 } | 357 } |
| OLD | NEW |