fix for changed shutdown order in PHP-7.4
authorMichael Wallner <mike@php.net>
Mon, 21 Oct 2019 11:38:09 +0000 (13:38 +0200)
committerMichael Wallner <mike@php.net>
Mon, 21 Oct 2019 11:38:09 +0000 (13:38 +0200)
src/php_http_client.c
src/php_http_client.h
tests/client028.phpt

index ed38522..9551dd0 100644 (file)
@@ -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;
 
        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)
        }
 
        ZEND_HASH_FOREACH_VAL(props, val)
index 0edd1bb..fd77204 100644 (file)
@@ -35,6 +35,7 @@ typedef struct php_http_client_enqueue {
                zend_fcall_info fci;
                zend_fcall_info_cache fcc;
        } closure;
                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);
 } php_http_client_enqueue_t;
 
 typedef struct php_http_client *(*php_http_client_init_func_t)(struct php_http_client *p, void *init_arg);
index e266243..f14fb8e 100644 (file)
@@ -137,5 +137,5 @@ server("proxy.inc", function($port) {
 ===DONE===
 --EXPECTREGEX--
 Test
 ===DONE===
 --EXPECTREGEX--
 Test
-[ST][WST]*([OWST]*)+U+int\(200\)
+[ST][WST]*([OWSTU]*)+U+int\(200\)
 O*===DONE===
 O*===DONE===