[Varnish] #970: partial content code 206 - visible as '206' in varnishncsa and as '200' from VCL code

Varnish varnish-bugs at varnish-cache.org
Mon Aug 1 11:07:20 CEST 2011


#970: partial content code 206 - visible as '206' in varnishncsa and as '200'
from VCL code
-------------------------------------------------+--------------------------
 Reporter:  jhalfmoon                            |        Type:  defect  
   Status:  new                                  |    Priority:  normal  
Milestone:                                       |   Component:  varnishd
  Version:  3.0.0                                |    Severity:  normal  
 Keywords:  206 partial content varnishncsa vcl  |  
-------------------------------------------------+--------------------------
 Hi there,

 It seems that when varnishd returns partial content to a browser,
 Varnishnsca properly logs the transfer with a code 206 'partial content',
 but logging the exact same transfer from VCL code, it returns code '200',
 which is incorrect. I have tried using VRT_r_obj_status, VRT_r_rest_status
 and VRT_r_beresp status to no avail. This is the case with both Varnish
 2.1.5 and 3.0.0.

 Is this done on purpose by the code or can it be registered as a bug? This
 is how I test it (examples using Varnish 3.0.0):

 #=== The command to do the RANGE request (note the returncode 206 'partial
 content) ===

 testproxy02 ~ # http_proxy=http://127.0.0.1:80 curl -v -r 500-1000
 http://vi.nl
 .
 .
 Proxy-Connection: Keep-Alive
 < HTTP/1.1 206 Partial Content < Server: Apache
 .
 ...<output truncated>...

 #=== This is the output of varnishncsa (note the code '206')===

 testproxy02 ~ # varnishncsa 127.0.0.1 - - [28/Jul/2011:17:17:23 +0200]
 "GET http://bla.nlhttp://bla.nl HTTP/1.1" 206 501 "-" "curl/7.15.5 (x86_64
 -redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5"

 #=== This is the output I get in syslog (note the code '200') ===

 testproxy02 ~ # tail -f /var/log/varnish/current
  code:200
  127.0.0.1 - - "Thu, 28 Jul 2011 15:16:56 GMT" "GET http://bla.nl" 200
 58944 "-" "curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5
 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5" X:616508938 B:bla_nl V:bla.nl h:1

 #=== This is the bit of inline C code used to do the loggin from VCL ===

 int mycode = VRT_r_resp_status(sp);
 if (mycode == NULL) { mycode = 0; }
 syslog(LOG_DEBUG, "code:%u ", mycode );
 .
 ...<output truncated>...

 #=== EOF ===

-- 
Ticket URL: <http://varnish-cache.org/trac/ticket/970>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list