You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/09/10 17:10:00 UTC

[34/48] git commit: TS-1086: Avoid returning 304 to an unconditional request. Diagnosis and patch by Mohamad Khateeb.

TS-1086: Avoid returning 304 to an unconditional request.
Diagnosis and patch by Mohamad Khateeb.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e8672a89
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e8672a89
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e8672a89

Branch: refs/heads/5.0.x
Commit: e8672a8934f468a4bf3fd34b3d573c783a5398cf
Parents: 8489d51
Author: Nick Kew <nk...@qualys.com>
Authored: Mon Sep 9 16:35:48 2013 +0100
Committer: Nick Kew <nk...@qualys.com>
Committed: Mon Sep 9 16:38:35 2013 +0100

----------------------------------------------------------------------
 CHANGES                    | 3 +++
 proxy/http/HttpTransact.cc | 7 +++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e8672a89/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a8b1318..1c7d948 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
 
+  *) [TS-1086] Avoid edge case returning 304 to an unconditional request.
+     Diagnosis and patch by Mohamad Khateeb.
+
   *) [TS-2168] Make RecordsConfig.cc more inline with default builds.
 
   *) [TS-2174] traffic_shell/traffic_line miss some stats value

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e8672a89/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index e39e7e9..512a1cc 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -2853,13 +2853,20 @@ HttpTransact::handle_cache_write_lock(State* s)
   //  we're tunneling response anyway
   if (remove_ims) {
     s->hdr_info.server_request.field_delete(MIME_FIELD_IF_MODIFIED_SINCE, MIME_LEN_IF_MODIFIED_SINCE);
+    s->hdr_info.server_request.field_delete(MIME_FIELD_IF_NONE_MATCH, MIME_LEN_IF_NONE_MATCH);
     MIMEField *c_ims = s->hdr_info.client_request.field_find(MIME_FIELD_IF_MODIFIED_SINCE, MIME_LEN_IF_MODIFIED_SINCE);
+    MIMEField *c_inm = s->hdr_info.client_request.field_find(MIME_FIELD_IF_NONE_MATCH, MIME_LEN_IF_NONE_MATCH);
 
     if (c_ims) {
       int len;
       const char *value = c_ims->value_get(&len);
       s->hdr_info.server_request.value_set(MIME_FIELD_IF_MODIFIED_SINCE, MIME_LEN_IF_MODIFIED_SINCE, value, len);
     }
+    if (c_inm) {
+      int len;
+      const char *value = c_inm->value_get(&len);
+      s->hdr_info.server_request.value_set(MIME_FIELD_IF_NONE_MATCH, MIME_LEN_IF_NONE_MATCH, value, len);
+    }
   }
 
   if (s->cache_info.write_lock_state == CACHE_WL_READ_RETRY) {