[Varnish] #788: v2.1.3 w/ http_range_support on fails to support sets in byte range request

Varnish varnish-bugs at varnish-cache.org
Tue Nov 16 13:50:08 CET 2010


#788: v2.1.3 w/ http_range_support on fails to support sets in byte range request
--------------------------+-------------------------------------------------
 Reporter:  jim.robinson  |       Owner:  phk                              
     Type:  defect        |      Status:  new                              
 Priority:  normal        |   Milestone:                                   
Component:  build         |     Version:  2.1.3                            
 Severity:  normal        |    Keywords:  http_range_support byte range set
--------------------------+-------------------------------------------------

Comment(by jnerin):

 Well, I'm not sure how widespread may be, but I have one example, it's
 Adobe Acrobat trying to display a pdf embedded in the browser (the pdf
 file size is 7271640 bytes):

 Header from a tcpdump decoded with wireshark:

 {{{
 GET /example.pdf HTTP/1.1
 Host: www.example.com
 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9.2.12)
 Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729)
 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
 Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3
 Accept-Encoding: gzip,deflate
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
 Keep-Alive: 115
 Connection: keep-alive
 Range: bytes=8380-32397,8380-8381
 }}}


 If first issues on request with no range:


 {{{
   702 RxRequest    c GET
   702 RxURL        c /example.pdf
   702 RxProtocol   c HTTP/1.1
   702 RxHeader     c Host: www.example.com
   702 RxHeader     c User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1;
 es-ES; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729)
   702 RxHeader     c Accept:
 text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   702 RxHeader     c Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3
   702 RxHeader     c Accept-Encoding: gzip,deflate
   702 RxHeader     c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
   702 RxHeader     c Keep-Alive: 115
   702 RxHeader     c Connection: keep-alive
   702 RxHeader     c Referer: http://www.example.com/
   702 VCL_call     c recv
   702 VCL_return   c lookup
   702 VCL_call     c hash
   702 VCL_return   c hash
   702 VCL_call     c miss
   702 VCL_return   c fetch
   702 Backend      c 674 default default
   674 TxRequest    b GET
   674 TxURL        b /example.pdf
   674 TxProtocol   b HTTP/1.1
   674 TxHeader     b Host: www.example.com
   674 TxHeader     b User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1;
 es-ES; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729)
   674 TxHeader     b Accept:
 text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   674 TxHeader     b Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3
   674 TxHeader     b Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
   674 TxHeader     b Referer: http://www.example.com/
   674 TxHeader     b Accept-Encoding: gzip
   674 TxHeader     b X-Varnish: 1459169995
 [...]
   702 TTL          c 1459169995 RFC 120 1289908815 0 0 0 0
   702 VCL_call     c fetch
   702 VCL_return   c deliver
   702 ObjProtocol  c HTTP/1.1
   702 ObjStatus    c 200
   702 ObjResponse  c OK
   702 ObjHeader    c Date: Tue, 16 Nov 2010 12:00:15 GMT
   702 ObjHeader    c Server: Apache
   702 ObjHeader    c Last-Modified: Tue, 16 Nov 2010 07:38:04 GMT
   702 ObjHeader    c ETag: "18616f87-6ef4d8-49526a311ef00"
   702 ObjHeader    c Content-Type: application/pdf
   702 ObjHeader    c X-Cacheable: YES
   674 Length       b 7271640
   674 BackendReuse b default
 [...]
   702 SessionClose c remote closed
   702 VCL_call     c deliver
   702 VCL_return   c deliver
   702 TxProtocol   c HTTP/1.1
   702 TxStatus     c 200
   702 TxResponse   c OK
   702 TxHeader     c Server: Apache
   702 TxHeader     c Last-Modified: Tue, 16 Nov 2010 07:38:04 GMT
   702 TxHeader     c ETag: "18616f87-6ef4d8-49526a311ef00"
   702 TxHeader     c Content-Type: application/pdf
   702 TxHeader     c X-Cacheable: YES
   702 TxHeader     c Content-Length: 7271640
   702 TxHeader     c Accept-Ranges: bytes
   702 TxHeader     c Date: Tue, 16 Nov 2010 12:00:15 GMT
   702 TxHeader     c X-Varnish: 1459169995
   702 TxHeader     c Age: 0
   702 TxHeader     c Via: 1.1 varnish
   702 TxHeader     c Connection: keep-alive
   702 TxHeader     c X-Served-By: varnish
   702 TxHeader     c X-Cache: MISS
   702 TxHeader     c X-Cache-Hits: 0
   702 Debug        c "Write error, retval = 32120, len = 7272020, errno =
 Success"
    -1 Length       - 7271640
   702 ReqEnd       c 1459169995 1289908815.705988407 1289908816.018261433
 2.889583826 0.033922911 0.278350115
   702 StatSess     c xxx.xxx.xxx.xxx 13723 3 1 3 0 0 2 1179 7272197

 }}}

 Then reissues the same request but with a range:


 {{{
   282 ReqStart     c xxx.xxx.xxx.xxx 13724 1459170027
   282 RxRequest    c GET
   282 RxURL        c /example.pdf
   282 RxProtocol   c HTTP/1.1
   282 RxHeader     c Host: www.example.com
   282 RxHeader     c User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1;
 es-ES; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 ( .NET CLR 3.5.30729)
   282 RxHeader     c Accept:
 text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
   282 RxHeader     c Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3
   282 RxHeader     c Accept-Encoding: gzip,deflate
   282 RxHeader     c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
   282 RxHeader     c Keep-Alive: 115
   282 RxHeader     c Connection: keep-alive
   282 RxHeader     c Range: bytes=8380-32397,8380-8381
   282 VCL_call     c recv
   282 VCL_return   c lookup
   282 VCL_call     c hash
   282 VCL_return   c hash
   282 Hit          c 1459169995
   282 VCL_call     c hit
   282 VCL_return   c deliver
   282 VCL_call     c deliver
   282 VCL_return   c deliver
   282 TxProtocol   c HTTP/1.1
   282 TxStatus     c 200
   282 TxResponse   c OK
   282 TxHeader     c Server: Apache
   282 TxHeader     c Last-Modified: Tue, 16 Nov 2010 07:38:04 GMT
   282 TxHeader     c ETag: "18616f87-6ef4d8-49526a311ef00"
   282 TxHeader     c Content-Type: application/pdf
   282 TxHeader     c X-Cacheable: YES
   282 TxHeader     c Content-Length: 7271640
   282 TxHeader     c Accept-Ranges: bytes
   282 TxHeader     c Date: Tue, 16 Nov 2010 12:00:15 GMT
   282 TxHeader     c X-Varnish: 1459170027 1459169995
   282 TxHeader     c Age: 0
   282 TxHeader     c Via: 1.1 varnish
   282 TxHeader     c Connection: keep-alive
   282 TxHeader     c X-Served-By: varnish
   282 TxHeader     c X-Cache: HIT
   282 TxHeader     c X-Cache-Hits: 1
   282 Length       c 7271640
   282 ReqEnd       c 1459170027 1289908815.935475588 1289908831.356354237
 3.038742304 0.000062466 15.420816183
 }}}


 At this point the browser is stuck waiting for data forever. I don't know
 why it asks for this absurd range pair.

 For the moment we have sidestepped the issue adding this to vcl_recv:

 {{{
 vcl_recv {
 [...]
         if (req.http.Range) {
                 return(pipe);
         }
 [...]
 }
 }}}

-- 
Ticket URL: <http://www.varnish-cache.org/trac/ticket/788#comment:2>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list