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/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1384 bool URLRequestHttpJob::ShouldFixMismatchedContentLength(int rv) const { | 1384 bool URLRequestHttpJob::ShouldFixMismatchedContentLength(int rv) const { |
1385 // Some servers send the body compressed, but specify the content length as | 1385 // Some servers send the body compressed, but specify the content length as |
1386 // the uncompressed size. Although this violates the HTTP spec we want to | 1386 // the uncompressed size. Although this violates the HTTP spec we want to |
1387 // support it (as IE and FireFox do), but *only* for an exact match. | 1387 // support it (as IE and FireFox do), but *only* for an exact match. |
1388 // See http://crbug.com/79694. | 1388 // See http://crbug.com/79694. |
1389 if (rv == ERR_CONTENT_LENGTH_MISMATCH || | 1389 if (rv == ERR_CONTENT_LENGTH_MISMATCH || |
1390 rv == ERR_INCOMPLETE_CHUNKED_ENCODING) { | 1390 rv == ERR_INCOMPLETE_CHUNKED_ENCODING) { |
1391 if (request_ && request_->response_headers()) { | 1391 if (request_ && request_->response_headers()) { |
1392 int64_t expected_length = | 1392 int64_t expected_length = |
1393 request_->response_headers()->GetContentLength(); | 1393 request_->response_headers()->GetContentLength(); |
1394 VLOG(1) << __FUNCTION__ << "() " | 1394 VLOG(1) << __func__ << "() \"" << request_->url().spec() << "\"" |
1395 << "\"" << request_->url().spec() << "\"" | |
1396 << " content-length = " << expected_length | 1395 << " content-length = " << expected_length |
1397 << " pre total = " << prefilter_bytes_read() | 1396 << " pre total = " << prefilter_bytes_read() |
1398 << " post total = " << postfilter_bytes_read(); | 1397 << " post total = " << postfilter_bytes_read(); |
1399 if (postfilter_bytes_read() == expected_length) { | 1398 if (postfilter_bytes_read() == expected_length) { |
1400 // Clear the error. | 1399 // Clear the error. |
1401 return true; | 1400 return true; |
1402 } | 1401 } |
1403 } | 1402 } |
1404 } | 1403 } |
1405 return false; | 1404 return false; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 // Notify NetworkQualityEstimator. | 1653 // Notify NetworkQualityEstimator. |
1655 if (request()) { | 1654 if (request()) { |
1656 NetworkQualityEstimator* network_quality_estimator = | 1655 NetworkQualityEstimator* network_quality_estimator = |
1657 request()->context()->network_quality_estimator(); | 1656 request()->context()->network_quality_estimator(); |
1658 if (network_quality_estimator) | 1657 if (network_quality_estimator) |
1659 network_quality_estimator->NotifyURLRequestDestroyed(*request()); | 1658 network_quality_estimator->NotifyURLRequestDestroyed(*request()); |
1660 } | 1659 } |
1661 } | 1660 } |
1662 | 1661 |
1663 } // namespace net | 1662 } // namespace net |
OLD | NEW |