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

Unified Diff: net/http/partial_data.cc

Issue 10829069: Http cache: Make sure that issuing a byte range request (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months 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
« net/http/http_cache_unittest.cc ('K') | « net/http/http_cache_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/partial_data.cc
===================================================================
--- net/http/partial_data.cc (revision 148620)
+++ net/http/partial_data.cc (working copy)
@@ -242,9 +242,6 @@
disk_cache::Entry* entry,
bool truncated) {
resource_size_ = 0;
- if (!headers->HasStrongValidators())
- return false;
-
if (truncated) {
DCHECK_EQ(headers->response_code(), 200);
// We don't have the real length and the user may be trying to create a
@@ -252,6 +249,9 @@
if (byte_range_.IsValid())
return false;
+ if (!headers->HasStrongValidators())
+ return false;
+
// Now we avoid resume if there is no content length, but that was not
// always the case so double check here.
int64 total_length = headers->GetContentLength();
@@ -270,7 +270,7 @@
return true;
}
- if (headers->response_code() == 200) {
+ if (headers->response_code() != 206) {
DCHECK(byte_range_.IsValid());
sparse_entry_ = false;
resource_size_ = entry->GetDataSize(kDataStream);
« net/http/http_cache_unittest.cc ('K') | « net/http/http_cache_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698