trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1049784 - in /trafficserver/traffic/trunk/proxy: Transform.cc http2/HttpTransact.cc
Date Thu, 16 Dec 2010 04:56:07 GMT
Author: ericb
Date: Thu Dec 16 04:56:07 2010
New Revision: 1049784

URL: http://svn.apache.org/viewvc?rev=1049784&view=rev
Log:
better Range: handling

Modified:
    trafficserver/traffic/trunk/proxy/Transform.cc
    trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc

Modified: trafficserver/traffic/trunk/proxy/Transform.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Transform.cc?rev=1049784&r1=1049783&r2=1049784&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Transform.cc (original)
+++ trafficserver/traffic/trunk/proxy/Transform.cc Thu Dec 16 04:56:07 2010
@@ -877,18 +877,28 @@ RangeTransform::parse_range_and_compare(
     while (value) {
       // If delimiter '-' is missing
       if (!(e = (const char *) memchr(value, '-', value_len))) {
-        value = csv.get_next(&value_len);
-        i++;
-        continue;
+        m_unsatisfiable_range = true;
+        return;
       }
-
-      s = value;
+      
+      if ( memcmp(value,"bytes=",6) == 0 ) {
+        s = value + 6;
+      }
+      else {
+        s = value;
+      }
+      
       m_ranges[i]._start = mime_parse_int64(s, e);
 
       e++;
       s = e;
       e = value + value_len;
-      m_ranges[i]._end = mime_parse_int64(s, e);
+      if ( e && *(e-1) == '-') { //open-ended Range: bytes=10-\r\n\r\n should be
supported
+        m_ranges[i]._end = -1;
+      }
+      else {
+        m_ranges[i]._end = mime_parse_int64(s, e);
+      }
 
       // check and change if necessary whether this is a right entry
       // the last _end bytes are required

Modified: trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc?rev=1049784&r1=1049783&r2=1049784&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpTransact.cc Thu Dec 16 04:56:07 2010
@@ -2839,8 +2839,7 @@ HttpTransact::build_response_from_cache(
         s->state_machine->do_range_setup_if_necessary();
         if (s->range_setup == RANGE_NOT_SATISFIABLE &&
             s->http_config_param->reverse_proxy_enabled) {
-          build_response(s, &s->hdr_info.client_response,
-                         s->client_info.http_version, HTTP_STATUS_RANGE_NOT_SATISFIABLE);
+          build_error_response(s, HTTP_STATUS_RANGE_NOT_SATISFIABLE, "Requested Range Not
Satisfiable","","");
 
           s->cache_info.action = CACHE_DO_NO_ACTION;
           s->next_action = PROXY_INTERNAL_CACHE_NOOP;



Mime
View raw message