Updated Branches:
  refs/heads/4.1.x 05252cc5e -> 89fc6dc1c

TS-2351 Bandaid fix for Range request crash related to
Read-While-Writer and content length calculations.

This hides a deeper problem where there is a seemingly serious reace
condition around Range and partially written cache entries. I'm going
to clone TS-2351 for a real investigation / fix.


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

Branch: refs/heads/4.1.x
Commit: 89fc6dc1c79a06b7d5b9707f6a8cf41aceb43f14
Parents: 05252cc
Author: Leif Hedstrom <[email protected]>
Authored: Thu Nov 28 20:42:46 2013 +0100
Committer: Igor Galić <[email protected]>
Committed: Fri Nov 29 10:31:26 2013 +0100

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/89fc6dc1/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index e2f9ac9..71e089c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.1
 
+  *) [TS-2351] Bandaid fix for Range request crash related to
+   Read-While-Writer and content length calculations.
 
   *) [TS-2384] Fix regression in key-lookup code between 4.0.x and 4.1.x
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/89fc6dc1/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 049e672..d6b7605 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -8685,7 +8685,7 @@ 
HttpTransact::change_response_header_because_of_range_request(State *s, HTTPHdr
 
     header->field_attach(field);
     header->set_content_length(s->range_output_cl);
-  } else {
+  } else if (s->cache_info.object_read) {
     char numbers[RANGE_NUMBERS_LENGTH];
     header->field_delete(MIME_FIELD_CONTENT_RANGE, MIME_LEN_CONTENT_RANGE);
     field = header->field_create(MIME_FIELD_CONTENT_RANGE, 
MIME_LEN_CONTENT_RANGE);

Reply via email to