Index: net/http/http_cache_transaction.cc |
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc |
index a69bcc0b4397632ecec8b46f39dcadf913873cc0..1057e20e0d28ba364299bd552681fdd49d91ee0e 100644 |
--- a/net/http/http_cache_transaction.cc |
+++ b/net/http/http_cache_transaction.cc |
@@ -449,10 +449,12 @@ bool HttpCache::Transaction::GetFullRequestHeaders( |
void HttpCache::Transaction::DoneReading() { |
if (cache_.get() && entry_) { |
- DCHECK(reading_); |
- DCHECK_NE(mode_, UPDATE); |
- if (mode_ & WRITE) |
+ if (mode_ & WRITE) { |
DoneWritingToEntry(true); |
+ } else { |
+ cache_->DoneReadingFromEntry(entry_, this); |
+ entry_ = NULL; |
+ } |
} |
} |
@@ -1340,10 +1342,6 @@ int HttpCache::Transaction::DoTruncateCachedMetadataComplete(int result) { |
} |
} |
- // If this response is a redirect, then we can stop writing now. (We don't |
- // need to cache the response body of a redirect.) |
- if (response_.headers->IsRedirect(NULL)) |
- DoneWritingToEntry(true); |
next_state_ = STATE_PARTIAL_HEADERS_RECEIVED; |
return OK; |
} |