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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 // We treat any other 1xx in this same way (although in practice getting | 1020 // We treat any other 1xx in this same way (although in practice getting |
1021 // a 1xx that isn't a 100 is rare). | 1021 // a 1xx that isn't a 100 is rare). |
1022 // Unless this is a WebSocket request, in which case we pass it on up. | 1022 // Unless this is a WebSocket request, in which case we pass it on up. |
1023 if (response_.headers->response_code() / 100 == 1 && | 1023 if (response_.headers->response_code() / 100 == 1 && |
1024 !ForWebSocketHandshake()) { | 1024 !ForWebSocketHandshake()) { |
1025 response_.headers = new HttpResponseHeaders(std::string()); | 1025 response_.headers = new HttpResponseHeaders(std::string()); |
1026 next_state_ = STATE_READ_HEADERS; | 1026 next_state_ = STATE_READ_HEADERS; |
1027 return OK; | 1027 return OK; |
1028 } | 1028 } |
1029 | 1029 |
1030 HostPortPair endpoint = HostPortPair(request_->url.HostNoBrackets(), | 1030 ProcessAlternateProtocol(session_, *response_.headers.get(), |
1031 request_->url.EffectiveIntPort()); | 1031 HostPortPair::FromURL(request_->url)); |
1032 ProcessAlternateProtocol(session_, | |
1033 *response_.headers.get(), | |
1034 endpoint); | |
1035 | 1032 |
1036 int rv = HandleAuthChallenge(); | 1033 int rv = HandleAuthChallenge(); |
1037 if (rv != OK) | 1034 if (rv != OK) |
1038 return rv; | 1035 return rv; |
1039 | 1036 |
1040 if (is_https_request()) | 1037 if (is_https_request()) |
1041 stream_->GetSSLInfo(&response_.ssl_info); | 1038 stream_->GetSSLInfo(&response_.ssl_info); |
1042 | 1039 |
1043 headers_valid_ = true; | 1040 headers_valid_ = true; |
1044 | 1041 |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1506 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
1510 state); | 1507 state); |
1511 break; | 1508 break; |
1512 } | 1509 } |
1513 return description; | 1510 return description; |
1514 } | 1511 } |
1515 | 1512 |
1516 #undef STATE_CASE | 1513 #undef STATE_CASE |
1517 | 1514 |
1518 } // namespace net | 1515 } // namespace net |
OLD | NEW |