[Varnish] #780: fetch_chunked fails to read trailing CRLF, prevents backend connection reuse

Varnish varnish-bugs at varnish-cache.org
Sun Sep 19 02:44:30 CEST 2010


#780: fetch_chunked fails to read trailing CRLF, prevents backend connection
reuse
----------------------+-----------------------------------------------------
 Reporter:  askalski  |        Type:  defect
   Status:  new       |    Priority:  normal
Milestone:            |   Component:  build 
  Version:  trunk     |    Severity:  normal
 Keywords:            |  
----------------------+-----------------------------------------------------
 bin/varnishd/cache_fetch.c

 The fetch_chunked() function is not reading in the final CRLF of the
 chunked response.  This prevents the backend connection from being reused.

 The relevant text from RFC 2616:

 {{{
        Chunked-Body   = *chunk
                         last-chunk
                         trailer
                         CRLF    <-- This is the CRLF I'm talking about.
 }}}

 And some strace output showing what's happening:

 {{{
 # Reading in the last-chunk...
 read(33, "0", 1)                        = 1
 read(33, "\r", 1)                       = 1
 read(33, "\n", 1)                       = 1
 # ...but not the final CRLF
 clock_gettime(CLOCK_REALTIME, {1284855439, 471704000}) = 0
 .
 .
 .
 # When it comes time to test re-usability of the backend, it fails
 # because that CRLF is still in the receive queue, waiting to be read.
 poll([{fd=33, events=POLLIN}], 1, 0)    = 1 ([{fd=33, revents=POLLIN}])
 close(33)                               = 0
 }}}

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




More information about the varnish-bugs mailing list