From: Michael Wallner Date: Thu, 30 Jul 2009 08:08:37 +0000 (+0000) Subject: fix http_get_request_body[_stream]() with FastCGI SAPI X-Git-Tag: RELEASE_1_6_5~3 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=1328a4c5ee9685aa5e71e10f1ba1cb81413b69a6 fix http_get_request_body[_stream]() with FastCGI SAPI --- diff --git a/http_api.c b/http_api.c index 4fa8c3d..06ac89a 100644 --- a/http_api.c +++ b/http_api.c @@ -357,6 +357,9 @@ PHP_HTTP_API STATUS _http_get_request_body_ex(char **body, size_t *length, zend_ memcpy(*body + *length, buf, len); *length += len; (*body)[*length] = '\0'; + if (len < sizeof(buf)) { + break; + } } /* check for error */ @@ -395,6 +398,9 @@ PHP_HTTP_API php_stream *_http_get_request_body_stream(TSRMLS_D) while (0 < (len = sapi_module.read_post(buf, sizeof(buf) TSRMLS_CC))) { php_stream_write(s, buf, len); + if (len < sizeof(buf)) { + break; + } } if (len < 0) { diff --git a/package2.xml b/package2.xml index fa3c600..f11b5d2 100644 --- a/package2.xml +++ b/package2.xml @@ -40,6 +40,7 @@ support. Parallel requests are available for PHP 5 and greater. BSD, revised