| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/server/http_server.h" | 5 #include "net/server/http_server.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 case ST_PROTO: | 274 case ST_PROTO: |
| 275 // TODO(mbelshe): Deal better with parsing protocol. | 275 // TODO(mbelshe): Deal better with parsing protocol. |
| 276 DCHECK(buffer == "HTTP/1.1"); | 276 DCHECK(buffer == "HTTP/1.1"); |
| 277 buffer.clear(); | 277 buffer.clear(); |
| 278 break; | 278 break; |
| 279 case ST_NAME: | 279 case ST_NAME: |
| 280 header_name = StringToLowerASCII(buffer); | 280 header_name = StringToLowerASCII(buffer); |
| 281 buffer.clear(); | 281 buffer.clear(); |
| 282 break; | 282 break; |
| 283 case ST_VALUE: | 283 case ST_VALUE: |
| 284 TrimWhitespaceASCII(buffer, TRIM_LEADING, &header_value); | 284 base::TrimWhitespaceASCII(buffer, base::TRIM_LEADING, &header_value); |
| 285 // TODO(mbelshe): Deal better with duplicate headers | 285 // TODO(mbelshe): Deal better with duplicate headers |
| 286 DCHECK(info->headers.find(header_name) == info->headers.end()); | 286 DCHECK(info->headers.find(header_name) == info->headers.end()); |
| 287 info->headers[header_name] = header_value; | 287 info->headers[header_name] = header_value; |
| 288 buffer.clear(); | 288 buffer.clear(); |
| 289 break; | 289 break; |
| 290 case ST_SEPARATOR: | 290 case ST_SEPARATOR: |
| 291 break; | 291 break; |
| 292 } | 292 } |
| 293 state = next_state; | 293 state = next_state; |
| 294 } else { | 294 } else { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 321 } | 321 } |
| 322 | 322 |
| 323 HttpConnection* HttpServer::FindConnection(StreamListenSocket* socket) { | 323 HttpConnection* HttpServer::FindConnection(StreamListenSocket* socket) { |
| 324 SocketToConnectionMap::iterator it = socket_to_connection_.find(socket); | 324 SocketToConnectionMap::iterator it = socket_to_connection_.find(socket); |
| 325 if (it == socket_to_connection_.end()) | 325 if (it == socket_to_connection_.end()) |
| 326 return NULL; | 326 return NULL; |
| 327 return it->second; | 327 return it->second; |
| 328 } | 328 } |
| 329 | 329 |
| 330 } // namespace net | 330 } // namespace net |
| OLD | NEW |