From: Michael Wallner Date: Tue, 8 Jul 2014 10:14:04 +0000 (+0200) Subject: Merge branch 'R_2_0' X-Git-Tag: RELEASE_2_1_0_RC1~34 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=51dcae85102bbf2ae1d2d41775d2a37f218b53aa;hp=a9934a75410f25ba6c27cd7c93b4211b15c70b5e Merge branch 'R_2_0' --- diff --git a/php_http_client.c b/php_http_client.c index 489177b..8a166fc 100644 --- a/php_http_client.c +++ b/php_http_client.c @@ -390,6 +390,9 @@ static STATUS handle_response(void *arg, php_http_client_t *client, php_http_cli zval *info, *zresponse, *zrequest; HashTable *info_ht; + /* ensure the message is of type response (could be uninitialized in case of early error, like DNS) */ + php_http_message_set_type(msg, PHP_HTTP_RESPONSE); + if (z_is_true(zend_read_property(php_http_client_class_entry, &zclient, ZEND_STRL("recordHistory"), 0 TSRMLS_CC))) { handle_history(&zclient, *request, *response TSRMLS_CC); }