sas Wed Jun 4 01:13:41 2003 EDT Modified files: (Branch: PHP_4_3) /php4/sapi/thttpd thttpd.c Log: Don't return CRLF from broken clients Index: php4/sapi/thttpd/thttpd.c diff -u php4/sapi/thttpd/thttpd.c:1.77.2.12 php4/sapi/thttpd/thttpd.c:1.77.2.13 --- php4/sapi/thttpd/thttpd.c:1.77.2.12 Fri May 30 21:37:45 2003 +++ php4/sapi/thttpd/thttpd.c Wed Jun 4 01:13:41 2003 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: thttpd.c,v 1.77.2.12 2003/05/31 01:37:45 sniper Exp $ */ +/* $Id: thttpd.c,v 1.77.2.13 2003/06/04 05:13:41 sas Exp $ */ #include "php.h" #include "SAPI.h" @@ -44,6 +44,7 @@ httpd_conn *hc; void (*on_close)(int); + size_t unconsumed_length; smart_str sbuf; int seen_cl; int seen_cn; @@ -227,14 +228,12 @@ static int sapi_thttpd_read_post(char *buffer, uint count_bytes TSRMLS_DC) { size_t read_bytes = 0; - int c; - c = SIZEOF_UNCONSUMED_BYTES(); - if (c > 0) { - read_bytes = MIN(c, count_bytes); + if (TG(unconsumed_length) > 0) { + read_bytes = MIN(TG(unconsumed_length), count_bytes); memcpy(buffer, TG(hc)->read_buf + TG(hc)->checked_idx, read_bytes); + TG(unconsumed_length) -= read_bytes; CONSUME_BYTES(read_bytes); - count_bytes -= read_bytes; } return read_bytes; @@ -436,6 +435,8 @@ SG(request_info).content_type = strdup(TG(hc)->contenttype); SG(request_info).content_length = TG(hc)->contentlength == -1 ? 0 : TG(hc)->contentlength; + + TG(unconsumed_length) = SG(request_info).content_length; php_handle_auth_data(TG(hc)->authorization TSRMLS_CC); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php