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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 case ST_URL: | 281 case ST_URL: |
282 info->path = buffer; | 282 info->path = buffer; |
283 buffer.clear(); | 283 buffer.clear(); |
284 break; | 284 break; |
285 case ST_PROTO: | 285 case ST_PROTO: |
286 // TODO(mbelshe): Deal better with parsing protocol. | 286 // TODO(mbelshe): Deal better with parsing protocol. |
287 DCHECK(buffer == "HTTP/1.1"); | 287 DCHECK(buffer == "HTTP/1.1"); |
288 buffer.clear(); | 288 buffer.clear(); |
289 break; | 289 break; |
290 case ST_NAME: | 290 case ST_NAME: |
291 header_name = StringToLowerASCII(buffer); | 291 header_name = base::StringToLowerASCII(buffer); |
292 buffer.clear(); | 292 buffer.clear(); |
293 break; | 293 break; |
294 case ST_VALUE: | 294 case ST_VALUE: |
295 base::TrimWhitespaceASCII(buffer, base::TRIM_LEADING, &header_value); | 295 base::TrimWhitespaceASCII(buffer, base::TRIM_LEADING, &header_value); |
296 it = info->headers.find(header_name); | 296 it = info->headers.find(header_name); |
297 // See last paragraph ("Multiple message-header fields...") | 297 // See last paragraph ("Multiple message-header fields...") |
298 // of www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 | 298 // of www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 |
299 if (it == info->headers.end()) { | 299 if (it == info->headers.end()) { |
300 info->headers[header_name] = header_value; | 300 info->headers[header_name] = header_value; |
301 } else { | 301 } else { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 } | 338 } |
339 | 339 |
340 HttpConnection* HttpServer::FindConnection(StreamListenSocket* socket) { | 340 HttpConnection* HttpServer::FindConnection(StreamListenSocket* socket) { |
341 SocketToConnectionMap::iterator it = socket_to_connection_.find(socket); | 341 SocketToConnectionMap::iterator it = socket_to_connection_.find(socket); |
342 if (it == socket_to_connection_.end()) | 342 if (it == socket_to_connection_.end()) |
343 return NULL; | 343 return NULL; |
344 return it->second; | 344 return it->second; |
345 } | 345 } |
346 | 346 |
347 } // namespace net | 347 } // namespace net |
OLD | NEW |