| 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_proxy_client_socket.h" | 5 #include "net/http/http_proxy_client_socket.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 } | 269 } |
| 270 | 270 |
| 271 // We don't need to drain the response body, so we act as if we had drained | 271 // We don't need to drain the response body, so we act as if we had drained |
| 272 // the response body. | 272 // the response body. |
| 273 return DidDrainBodyForAuthRestart(keep_alive); | 273 return DidDrainBodyForAuthRestart(keep_alive); |
| 274 } | 274 } |
| 275 | 275 |
| 276 int HttpProxyClientSocket::DidDrainBodyForAuthRestart(bool keep_alive) { | 276 int HttpProxyClientSocket::DidDrainBodyForAuthRestart(bool keep_alive) { |
| 277 if (keep_alive && transport_->socket()->IsConnectedAndIdle()) { | 277 if (keep_alive && transport_->socket()->IsConnectedAndIdle()) { |
| 278 next_state_ = STATE_GENERATE_AUTH_TOKEN; | 278 next_state_ = STATE_GENERATE_AUTH_TOKEN; |
| 279 transport_->set_is_reused(true); | 279 transport_->set_reuse_type(ClientSocketHandle::REUSED_IDLE); |
| 280 } else { | 280 } else { |
| 281 // This assumes that the underlying transport socket is a TCP socket, | 281 // This assumes that the underlying transport socket is a TCP socket, |
| 282 // since only TCP sockets are restartable. | 282 // since only TCP sockets are restartable. |
| 283 next_state_ = STATE_TCP_RESTART; | 283 next_state_ = STATE_TCP_RESTART; |
| 284 transport_->socket()->Disconnect(); | 284 transport_->socket()->Disconnect(); |
| 285 } | 285 } |
| 286 | 286 |
| 287 // Reset the other member variables. | 287 // Reset the other member variables. |
| 288 drain_buf_ = NULL; | 288 drain_buf_ = NULL; |
| 289 parser_buf_ = NULL; | 289 parser_buf_ = NULL; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 | 529 |
| 530 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { | 530 int HttpProxyClientSocket::DoTCPRestartComplete(int result) { |
| 531 if (result != OK) | 531 if (result != OK) |
| 532 return result; | 532 return result; |
| 533 | 533 |
| 534 next_state_ = STATE_GENERATE_AUTH_TOKEN; | 534 next_state_ = STATE_GENERATE_AUTH_TOKEN; |
| 535 return result; | 535 return result; |
| 536 } | 536 } |
| 537 | 537 |
| 538 } // namespace net | 538 } // namespace net |
| OLD | NEW |