Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Unified Diff: net/http/http_cache.cc

Issue 348053: Http cache: Make sure that we handle byte range requests that... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/http/http_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.cc
===================================================================
--- net/http/http_cache.cc (revision 30779)
+++ net/http/http_cache.cc (working copy)
@@ -462,10 +462,13 @@
if (!(mode_ & READ) && effective_load_flags_ & LOAD_ONLY_FROM_CACHE)
return ERR_CACHE_MISS;
- if (mode_ == NONE)
+ if (mode_ == NONE) {
+ if (partial_.get())
+ partial_->RestoreHeaders(&custom_request_->extra_headers);
rv = BeginNetworkRequest();
- else
+ } else {
rv = AddToEntry();
+ }
// setting this here allows us to check for the existance of a callback_ to
// determine if we are still inside Start.
@@ -656,6 +659,8 @@
if (!entry) {
DLOG(WARNING) << "unable to create cache entry";
mode_ = NONE;
+ if (partial_.get())
+ partial_->RestoreHeaders(&custom_request_->extra_headers);
return BeginNetworkRequest();
}
}
@@ -1586,7 +1591,7 @@
}
if (result >= 0 || result == net::ERR_IO_PENDING)
return;
- } else if (partial_.get()) {
+ } else if (mode_ != NONE && partial_.get()) {
// We are about to return the headers for a byte-range request to the
// user, so let's fix them.
partial_->FixResponseHeaders(response_.headers);
« no previous file with comments | « no previous file | net/http/http_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698