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

Side by Side Diff: net/http/http_cache_transaction.cc

Issue 460098: Http cache: Don't use multiple validation headers when... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/http/http_cache_transaction.h" 5 #include "net/http/http_cache_transaction.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 if (!etag_value.empty()) { 1088 if (!etag_value.empty()) {
1089 if (partial_.get() && !partial_->IsCurrentRangeCached()) { 1089 if (partial_.get() && !partial_->IsCurrentRangeCached()) {
1090 // We don't want to switch to WRITE mode if we don't have this block of a 1090 // We don't want to switch to WRITE mode if we don't have this block of a
1091 // byte-range request because we may have other parts cached. 1091 // byte-range request because we may have other parts cached.
1092 custom_request_->extra_headers.append("If-Range: "); 1092 custom_request_->extra_headers.append("If-Range: ");
1093 } else { 1093 } else {
1094 custom_request_->extra_headers.append("If-None-Match: "); 1094 custom_request_->extra_headers.append("If-None-Match: ");
1095 } 1095 }
1096 custom_request_->extra_headers.append(etag_value); 1096 custom_request_->extra_headers.append(etag_value);
1097 custom_request_->extra_headers.append("\r\n"); 1097 custom_request_->extra_headers.append("\r\n");
1098 if (partial_.get() && partial_->IsCurrentRangeCached()) 1098 // For byte-range requests, make sure that we use only one way to validate
1099 // the request.
1100 if (partial_.get())
1099 return true; 1101 return true;
1100 } 1102 }
1101 1103
1102 if (!last_modified_value.empty()) { 1104 if (!last_modified_value.empty()) {
1103 if (partial_.get() && !partial_->IsCurrentRangeCached()) { 1105 if (partial_.get() && !partial_->IsCurrentRangeCached()) {
1104 custom_request_->extra_headers.append("If-Range: "); 1106 custom_request_->extra_headers.append("If-Range: ");
1105 } else { 1107 } else {
1106 custom_request_->extra_headers.append("If-Modified-Since: "); 1108 custom_request_->extra_headers.append("If-Modified-Since: ");
1107 } 1109 }
1108 custom_request_->extra_headers.append(last_modified_value); 1110 custom_request_->extra_headers.append(last_modified_value);
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 response_.cert_request_info = response->cert_request_info; 1550 response_.cert_request_info = response->cert_request_info;
1549 } 1551 }
1550 return result; 1552 return result;
1551 } 1553 }
1552 1554
1553 void HttpCache::Transaction::OnIOComplete(int result) { 1555 void HttpCache::Transaction::OnIOComplete(int result) {
1554 DoLoop(result); 1556 DoLoop(result);
1555 } 1557 }
1556 1558
1557 } // namespace net 1559 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698