X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_client.c;h=8a166fc23acb5d345064dd5c2e586879d63ea1f6;hp=489177bf7a23fbcfdd347c875859ff79ba9b2afa;hb=1383635acbd8c6a1e4f747d0d1960f625c1c02a2;hpb=4f87b202b31968d3afc037f260e4281d91e8ff13 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); }