Chromium Code Reviews| Index: net/http/http_network_transaction.cc |
| diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc |
| index 4af4cd649b70b22161fceaf83a7f6ba6993b2e51..f7bbda4625be45cedb58277e30b414dcb70fb6f7 100644 |
| --- a/net/http/http_network_transaction.cc |
| +++ b/net/http/http_network_transaction.cc |
| @@ -570,6 +570,8 @@ void HttpNetworkTransaction::OnHttpsProxyTunnelResponse( |
| HttpStream* stream) { |
| DCHECK_EQ(STATE_CREATE_STREAM_COMPLETE, next_state_); |
| + CopyConnectionAttempts(); |
| + |
| headers_valid_ = true; |
| response_ = response_info; |
| server_ssl_config_ = used_ssl_config; |
| @@ -581,6 +583,10 @@ void HttpNetworkTransaction::OnHttpsProxyTunnelResponse( |
| OnIOComplete(ERR_HTTPS_PROXY_TUNNEL_RESPONSE); |
| } |
| +const ConnectionAttempts& HttpNetworkTransaction::connection_attempts() const { |
| + return connection_attempts_; |
| +} |
| + |
| bool HttpNetworkTransaction::IsSecureRequest() const { |
| return request_->url.SchemeIsSecure(); |
| } |
| @@ -761,6 +767,9 @@ int HttpNetworkTransaction::DoCreateStream() { |
| } |
| int HttpNetworkTransaction::DoCreateStreamComplete(int result) { |
| + if (result != ERR_HTTPS_PROXY_TUNNEL_RESPONSE) |
|
Randy Smith (Not in Mondays)
2015/04/10 21:15:03
Willing to educate me about why a proxy tunnel res
Deprecated (see juliatuttle)
2015/04/14 19:14:45
Yes: we reset stream_request_ in OnHttpsProxyTunne
Randy Smith (Not in Mondays)
2015/04/15 20:19:07
Yes, please. (If it were arcana about tunneling i
|
| + CopyConnectionAttempts(); |
| + |
| if (result == OK) { |
| next_state_ = STATE_INIT_STREAM; |
| DCHECK(stream_.get()); |
| @@ -1559,4 +1568,14 @@ std::string HttpNetworkTransaction::DescribeState(State state) { |
| #undef STATE_CASE |
| +void HttpNetworkTransaction::CopyConnectionAttempts() { |
| + DCHECK(stream_request_); |
| + |
| + // Since the transaction can restart with auth credentials, it may create a |
| + // stream more than once. Accumulate all of the connection attempts across |
| + // those streams by appending them to the vector: |
| + for (const auto& attempt : stream_request_->connection_attempts()) |
| + connection_attempts_.push_back(attempt); |
| +} |
| + |
| } // namespace net |