From: Michael Wallner Date: Mon, 21 Oct 2019 11:38:09 +0000 (+0200) Subject: fix for changed shutdown order in PHP-7.4 X-Git-Tag: RELEASE_3_2_2~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=ba429472d56e45d8ce65d47ec0b5027f3bba4407;p=m6w6%2Fext-http fix for changed shutdown order in PHP-7.4 --- diff --git a/src/php_http_client.c b/src/php_http_client.c index ed38522..9551dd0 100644 --- a/src/php_http_client.c +++ b/src/php_http_client.c @@ -401,8 +401,9 @@ static HashTable *php_http_client_object_get_gc(zval *object, zval **table, int for (el = obj->client->requests.head; el; el = el->next) { php_http_client_enqueue_t *q = (php_http_client_enqueue_t *) el->data; - php_http_message_object_t *request_obj = q->opaque; /* FIXME */ - ZVAL_OBJ(&obj->gc[(*n)++], &request_obj->zo); + if (q->request_obj) { + ZVAL_OBJ(&obj->gc[(*n)++], &q->request_obj->zo); + } } ZEND_HASH_FOREACH_VAL(props, val) diff --git a/src/php_http_client.h b/src/php_http_client.h index 0edd1bb..fd77204 100644 --- a/src/php_http_client.h +++ b/src/php_http_client.h @@ -35,6 +35,7 @@ typedef struct php_http_client_enqueue { zend_fcall_info fci; zend_fcall_info_cache fcc; } closure; + php_http_message_object_t *request_obj; /* supplemental to request */ } php_http_client_enqueue_t; typedef struct php_http_client *(*php_http_client_init_func_t)(struct php_http_client *p, void *init_arg); diff --git a/tests/client028.phpt b/tests/client028.phpt index e266243..f14fb8e 100644 --- a/tests/client028.phpt +++ b/tests/client028.phpt @@ -137,5 +137,5 @@ server("proxy.inc", function($port) { ===DONE=== --EXPECTREGEX-- Test -[ST][WST]*([OWST]*)+U+int\(200\) +[ST][WST]*([OWSTU]*)+U+int\(200\) O*===DONE===