Changeset 1985

Show
Ignore:
Timestamp:
09/06/2007 11:24:20 AM (12 months ago)
Author:
jan
Message:

* fixed hanging redirects with keep-alive due to missing

"Content-Length: 0" headers

Location:
branches/lighttpd-1.4.x
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/NEWS

    r1983 r1985  
    88  * fixed forwarding a SIGINT and SIGHUP when using max-workers (#902) 
    99  * fixed FastCGI header overrun in mod_fastcgi (reported by mattias@secweb.se) 
     10  * fixed hanging redirects with keep-alive due to missing  
     11    "Content-Length: 0" headers 
    1012 
    1113 
  • branches/lighttpd-1.4.x/src/connections.c

    r1946 r1985  
    538538                            con->http_status == 304) { 
    539539                                /* no Content-Body, no Content-Length */ 
    540                         } else if (qlen > 0) { 
     540                        } else if (qlen >= 0) { 
     541                                /* qlen = 0 is important for Redirects (301, ...) as they MAY have 
     542                                 * a content. Browsers are waiting for a Content otherwise 
     543                                 */ 
    541544                                buffer_copy_off_t(srv->tmp_buf, chunkqueue_length(con->write_queue)); 
    542545 
  • branches/lighttpd-1.4.x/tests/mod-redirect.t

    r1374 r1985  
    99use strict; 
    1010use IO::Socket; 
    11 use Test::More tests => 6; 
     11use Test::More tests => 7; 
    1212use LightyTest; 
    1313 
     
    2424$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/' } ]; 
    2525ok($tf->handle_http($t) == 0, 'external redirect'); 
     26 
     27$t->{REQUEST}  = ( <<EOF 
     28GET /redirect/ HTTP/1.0 
     29Host: vvv.example.org 
     30EOF 
     31 ); 
     32$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 301, 'Location' => 'http://localhost:'.$tf->{PORT}.'/', 'Content-Length' => '0' } ]; 
     33ok($tf->handle_http($t) == 0, 'external redirect should have a Content-Length: 0'); 
    2634 
    2735$t->{REQUEST} = ( <<EOF