[Varnish] #767: HTTP/1.1 and connection-close from back-end -> empty result from varnish

Varnish varnish-bugs at varnish-cache.org
Thu Sep 2 13:18:18 CEST 2010


#767: HTTP/1.1 and connection-close from back-end -> empty result from varnish
----------------------+-----------------------------------------------------
 Reporter:  ysimon    |       Owner:  phk                       
     Type:  defect    |      Status:  new                       
 Priority:  normal    |   Milestone:  After Varnish 2.1         
Component:  varnishd  |     Version:  trunk                     
 Severity:  normal    |    Keywords:  connection-close, varnishd
----------------------+-----------------------------------------------------

Comment(by ysimon):

 Changing cache_fetch.c
 like this

 else if (http_HdrIs(hp, H_Connection, "close")) {
                 sp->wrk->stats.fetch_close++;
                 /*
                  * If we have connection closed, it is safe to read what
                  * comes in any case.
                  */
                 cls = fetch_eof(sp, sp->wrk->htc);
                 mklen = 1;
         }

 by

 else if (http_HdrIs(hp, H_Connection, "close")) {
                 sp->wrk->stats.fetch_close++;
                 /*
                  * If we have connection closed, it is safe to read what
                  * comes in any case.
                  */
                 cls = fetch_eof(sp, sp->wrk->htc);
         }

 seems to be a good solution

 because of that

 if (mklen > 0)
                 http_PrintfHeader(sp->wrk, sp->fd, sp->obj->http,
                     "Content-Length: %u", sp->obj->len);

-- 
Ticket URL: <http://varnish-cache.org/ticket/767#comment:1>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list