From 5df3bfd0128ebd48de13c95fc459110eb0463c30 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 12 Nov 2012 19:29:45 +0000 Subject: [PATCH] let the caller care for the message headers on serialisation if read filters are attached to the body resource --- php_http_message.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.30.2