OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 ShouldApplyServerAuth(), | 631 ShouldApplyServerAuth(), |
632 ShouldApplyProxyAuth(), using_proxy, | 632 ShouldApplyProxyAuth(), using_proxy, |
633 &request_headers_); | 633 &request_headers_); |
634 | 634 |
635 if (session_->network_delegate()) | 635 if (session_->network_delegate()) |
636 session_->network_delegate()->OnSendHttpRequest(&request_headers_); | 636 session_->network_delegate()->OnSendHttpRequest(&request_headers_); |
637 } | 637 } |
638 if (net_log_.IsLoggingAllEvents()) { | 638 if (net_log_.IsLoggingAllEvents()) { |
639 net_log_.AddEvent( | 639 net_log_.AddEvent( |
640 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_HEADERS, | 640 NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_HEADERS, |
641 new NetLogHttpRequestParameter(request_->url.spec(), | 641 make_scoped_refptr(new NetLogHttpRequestParameter( |
642 request_->extra_headers)); | 642 request_->url.spec(), request_->extra_headers))); |
643 } | 643 } |
644 | 644 |
645 headers_valid_ = false; | 645 headers_valid_ = false; |
646 return stream_->SendRequest(request_headers_, request_body, &response_, | 646 return stream_->SendRequest(request_headers_, request_body, &response_, |
647 &io_callback_); | 647 &io_callback_); |
648 } | 648 } |
649 | 649 |
650 int HttpNetworkTransaction::DoSendRequestComplete(int result) { | 650 int HttpNetworkTransaction::DoSendRequestComplete(int result) { |
651 if (result < 0) | 651 if (result < 0) |
652 return HandleIOError(result); | 652 return HandleIOError(result); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 // For now, if we get at least some data, we do the best we can to make | 725 // For now, if we get at least some data, we do the best we can to make |
726 // sense of it and send it back up the stack. | 726 // sense of it and send it back up the stack. |
727 int rv = HandleConnectionClosedBeforeEndOfHeaders(); | 727 int rv = HandleConnectionClosedBeforeEndOfHeaders(); |
728 if (rv != OK) | 728 if (rv != OK) |
729 return rv; | 729 return rv; |
730 } | 730 } |
731 | 731 |
732 if (net_log_.IsLoggingAllEvents()) { | 732 if (net_log_.IsLoggingAllEvents()) { |
733 net_log_.AddEvent( | 733 net_log_.AddEvent( |
734 NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS, | 734 NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS, |
735 new NetLogHttpResponseParameter(response_.headers)); | 735 make_scoped_refptr(new NetLogHttpResponseParameter(response_.headers))); |
736 } | 736 } |
737 | 737 |
738 if (response_.headers->GetParsedHttpVersion() < HttpVersion(1, 0)) { | 738 if (response_.headers->GetParsedHttpVersion() < HttpVersion(1, 0)) { |
739 // HTTP/0.9 doesn't support the PUT method, so lack of response headers | 739 // HTTP/0.9 doesn't support the PUT method, so lack of response headers |
740 // indicates a buggy server. See: | 740 // indicates a buggy server. See: |
741 // https://bugzilla.mozilla.org/show_bug.cgi?id=193921 | 741 // https://bugzilla.mozilla.org/show_bug.cgi?id=193921 |
742 if (request_->method == "PUT") | 742 if (request_->method == "PUT") |
743 return ERR_METHOD_NOT_SUPPORTED; | 743 return ERR_METHOD_NOT_SUPPORTED; |
744 } | 744 } |
745 | 745 |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 default: | 1166 default: |
1167 return priority; | 1167 return priority; |
1168 } | 1168 } |
1169 } | 1169 } |
1170 | 1170 |
1171 | 1171 |
1172 | 1172 |
1173 #undef STATE_CASE | 1173 #undef STATE_CASE |
1174 | 1174 |
1175 } // namespace net | 1175 } // namespace net |
OLD | NEW |