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 ed38522b0f9f2fac335b690062e0c64a88fe95cc..9551dd0bbe775f252a8893f090a17f06ddb5d36f 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;
-               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)
index 0edd1bb1d29d466652a5dc77d89c3b3e9a156c5b..fd77204fc6a53b772931b7ec36931f8486c20835 100644 (file)
@@ -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);
index e266243f758df14ac89682a117644ac74398e128..f14fb8e5f7d9aadf9ede5e772abf3c9028385f2d 100644 (file)
@@ -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===