]> granicus.if.org Git - php/commitdiff
thttpd initializes contentlength to -1, so we need to transfer that to 0
authorSascha Schumann <sas@php.net>
Fri, 25 Oct 2002 01:10:50 +0000 (01:10 +0000)
committerSascha Schumann <sas@php.net>
Fri, 25 Oct 2002 01:10:50 +0000 (01:10 +0000)
for SAPI/PHP.  Otherwise, SAPI will try to read (unsigned long) -1 bytes
from the connection.

sapi/thttpd/thttpd.c

index 0b66836e19ec2a0367c0e3929ce9979770d6593c..bb8b8c656df234fa4bb505de275542a011a39e22 100644 (file)
@@ -449,7 +449,8 @@ static void thttpd_request_ctor(TSRMLS_D)
        SG(request_info).request_method = httpd_method_str(TG(hc)->method);
        SG(sapi_headers).http_response_code = 200;
        SG(request_info).content_type = TG(hc)->contenttype;
-       SG(request_info).content_length = TG(hc)->contentlength;
+       SG(request_info).content_length = TG(hc)->contentlength == -1 ? 0
+               : TG(hc)->contentlength;
        
        php_handle_auth_data(TG(hc)->authorization TSRMLS_CC);
 }