X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_message.c;h=f8c414d5eb584cb1063cfd152c3c26fe44b27000;hb=b9b940d68c0569107bf1afefeca2a1e5f1efab04;hp=912de7014b8fd87b3cbaa32894b6de483fcc927c;hpb=628bdcb6edd65cb683b43af16cd0ce619b56d58a;p=m6w6%2Fext-http diff --git a/php_http_message.c b/php_http_message.c index 912de70..f8c414d 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -277,9 +277,12 @@ PHP_HTTP_API void php_http_message_update_headers(php_http_message_t *msg) { zval *h; size_t size; + php_stream *s; TSRMLS_FETCH_FROM_CTX(msg->ts); - if ((size = php_http_message_body_size(&msg->body))) { + if (php_http_message_body_stream(&msg->body)->readfilters.head) { + /* if a read stream filter is attached to the body the caller must also care for the headers */ + } else if ((size = php_http_message_body_size(&msg->body))) { MAKE_STD_ZVAL(h); ZVAL_LONG(h, size); zend_hash_update(&msg->hdrs, "Content-Length", sizeof("Content-Length"), &h, sizeof(zval *), NULL);