OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/trace_event.h" | 10 #include "base/trace_event.h" |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
750 // Error while reading the socket. | 750 // Error while reading the socket. |
751 done = true; | 751 done = true; |
752 } else { | 752 } else { |
753 content_read_ += result; | 753 content_read_ += result; |
754 if (unfiltered_eof || | 754 if (unfiltered_eof || |
755 (content_length_ != -1 && content_read_ >= content_length_) || | 755 (content_length_ != -1 && content_read_ >= content_length_) || |
756 (chunked_decoder_.get() && chunked_decoder_->reached_eof())) { | 756 (chunked_decoder_.get() && chunked_decoder_->reached_eof())) { |
757 done = true; | 757 done = true; |
758 keep_alive = response_.headers->IsKeepAlive(); | 758 keep_alive = response_.headers->IsKeepAlive(); |
759 // We can't reuse the connection if we read more than the advertised | 759 // We can't reuse the connection if we read more than the advertised |
760 // content length. | 760 // content length, or if the tunnel was not established. |
wtc
2008/11/04 15:08:03
Add "successfully" after "established" to make it
| |
761 if (unfiltered_eof || | 761 if (establishing_tunnel_ || unfiltered_eof || |
762 (content_length_ != -1 && content_read_ > content_length_)) | 762 (content_length_ != -1 && content_read_ > content_length_)) |
763 keep_alive = false; | 763 keep_alive = false; |
764 } | 764 } |
765 } | 765 } |
766 | 766 |
767 // Clean up the HttpConnection if we are done. | 767 // Clean up the HttpConnection if we are done. |
768 if (done) { | 768 if (done) { |
769 // TODO(eroman): Temporary for 3772 bug investigation. | 769 // TODO(eroman): Temporary for 3772 bug investigation. |
770 if (keep_alive && using_ssl_ && !connection_.socket()->IsSSL()) { | 770 if (keep_alive && using_ssl_ && !connection_.socket()->IsSSL()) { |
771 // It is invalid to be recycling a TCPClientSocket. | 771 // It is invalid to be recycling a TCPClientSocket. |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1152 auth_data_[target]->state = AUTH_STATE_NEED_AUTH; | 1152 auth_data_[target]->state = AUTH_STATE_NEED_AUTH; |
1153 } | 1153 } |
1154 | 1154 |
1155 response_.auth_challenge.swap(auth_info); | 1155 response_.auth_challenge.swap(auth_info); |
1156 auth_handler_[target].reset(auth_handler.release()); | 1156 auth_handler_[target].reset(auth_handler.release()); |
1157 | 1157 |
1158 return OK; | 1158 return OK; |
1159 } | 1159 } |
1160 | 1160 |
1161 } // namespace net | 1161 } // namespace net |
OLD | NEW |