From: Michael Wallner Date: Mon, 12 Nov 2012 19:29:45 +0000 (+0000) Subject: let the caller care for the message headers on serialisation if read filters are... X-Git-Tag: RELEASE_2_1_0_RC3~10^2^2~99 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=5df3bfd0128ebd48de13c95fc459110eb0463c30;p=m6w6%2Fext-http let the caller care for the message headers on serialisation if read filters are attached to the body resource --- 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);