Chromium Code Reviews| Index: net/url_request/url_request_http_job.cc |
| diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc |
| index d22cff78035be33dcce419f1e85aaa501b786744..0f686c963b7a18dd960f137b346850cf1109281e 100644 |
| --- a/net/url_request/url_request_http_job.cc |
| +++ b/net/url_request/url_request_http_job.cc |
| @@ -319,7 +319,27 @@ void URLRequestHttpJob::NotifyHeadersComplete() { |
| URLRequestJob::NotifyHeadersComplete(); |
| } |
| -void URLRequestHttpJob::NotifyDone(const URLRequestStatus& status) { |
| +void URLRequestHttpJob::NotifyDone(const URLRequestStatus& original_status) { |
| + URLRequestStatus status(original_status); |
| + // Some servers send the body compressed, but specify the content length as |
| + // the uncompressed size. Although this violates the HTTP spec we want to |
| + // support it (as IE and FireFox do), but *only* for an exact match. |
| + // See http://crbug.com/79694. |
| + if (status.os_error() == net::ERR_CONNECTION_CLOSED) { |
| + if (request_ && request_->response_headers()) { |
| + int64 expected_length = request_->response_headers()->GetContentLength(); |
| + VLOG(1) << __FUNCTION__ << "() " |
| + << "\"" << request_->url().spec() << "\"" |
| + << " content-length = " << expected_length |
| + << " pre total = " << prefilter_bytes_read() |
| + << " post total = " << postfilter_bytes_read(); |
| + if (postfilter_bytes_read() == expected_length) { |
| + // Clear the error. |
| + status = URLRequestStatus(); |
|
willchan no longer on Chromium
2011/05/23 22:12:26
I'd prefer if you explicitly set the fields to OK.
ahendrickson
2011/05/24 04:58:37
OK, but this is the way it's done in the rest of t
|
| + } |
| + } |
| + } |
| + |
| RecordCompressionHistograms(); |
| URLRequestJob::NotifyDone(status); |
| } |