| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 case ST_URL: | 405 case ST_URL: |
| 406 info->path = buffer; | 406 info->path = buffer; |
| 407 buffer.clear(); | 407 buffer.clear(); |
| 408 break; | 408 break; |
| 409 case ST_PROTO: | 409 case ST_PROTO: |
| 410 // TODO(mbelshe): Deal better with parsing protocol. | 410 // TODO(mbelshe): Deal better with parsing protocol. |
| 411 DCHECK(buffer == "HTTP/1.1"); | 411 DCHECK(buffer == "HTTP/1.1"); |
| 412 buffer.clear(); | 412 buffer.clear(); |
| 413 break; | 413 break; |
| 414 case ST_NAME: | 414 case ST_NAME: |
| 415 header_name = base::StringToLowerASCII(buffer); | 415 header_name = base::ToLowerASCII(buffer); |
| 416 buffer.clear(); | 416 buffer.clear(); |
| 417 break; | 417 break; |
| 418 case ST_VALUE: | 418 case ST_VALUE: |
| 419 base::TrimWhitespaceASCII(buffer, base::TRIM_LEADING, &header_value); | 419 base::TrimWhitespaceASCII(buffer, base::TRIM_LEADING, &header_value); |
| 420 it = info->headers.find(header_name); | 420 it = info->headers.find(header_name); |
| 421 // See the second paragraph ("A sender MUST NOT generate multiple | 421 // See the second paragraph ("A sender MUST NOT generate multiple |
| 422 // header fields...") of tools.ietf.org/html/rfc7230#section-3.2.2. | 422 // header fields...") of tools.ietf.org/html/rfc7230#section-3.2.2. |
| 423 if (it == info->headers.end()) { | 423 if (it == info->headers.end()) { |
| 424 info->headers[header_name] = header_value; | 424 info->headers[header_name] = header_value; |
| 425 } else { | 425 } else { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 | 463 |
| 464 // This is called after any delegate callbacks are called to check if Close() | 464 // This is called after any delegate callbacks are called to check if Close() |
| 465 // has been called during callback processing. Using the pointer of connection, | 465 // has been called during callback processing. Using the pointer of connection, |
| 466 // |connection| is safe here because Close() deletes the connection in next run | 466 // |connection| is safe here because Close() deletes the connection in next run |
| 467 // loop. | 467 // loop. |
| 468 bool HttpServer::HasClosedConnection(HttpConnection* connection) { | 468 bool HttpServer::HasClosedConnection(HttpConnection* connection) { |
| 469 return FindConnection(connection->id()) != connection; | 469 return FindConnection(connection->id()) != connection; |
| 470 } | 470 } |
| 471 | 471 |
| 472 } // namespace net | 472 } // namespace net |
| OLD | NEW |