From 0f97c6a0e3f840f64699d1f8ad3285f6037a105e Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Mon, 21 Feb 2005 12:29:02 +0000 Subject: [PATCH] packport fix from PHP5: read post data if they wreen't read # this is needed for FCGI correct functioning --- main/SAPI.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main/SAPI.c b/main/SAPI.c index b80435e160..2ac652cf08 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -388,6 +388,16 @@ SAPI_API void sapi_deactivate(TSRMLS_D) zend_llist_destroy(&SG(sapi_headers).headers); if (SG(request_info).post_data) { efree(SG(request_info).post_data); + } else if (SG(server_context)) { + if(sapi_module.read_post) { + /* make sure we've consumed all request input data */ + char dummy[SAPI_POST_BLOCK_SIZE]; + int read_bytes; + + while((read_bytes = sapi_module.read_post(dummy, sizeof(dummy)-1 TSRMLS_CC)) > 0) { + SG(read_post_bytes) += read_bytes; + } + } } if (SG(request_info).raw_post_data) { efree(SG(request_info).raw_post_data); -- 2.50.1