Skip to content

Commit 5766213

Browse files
committed
copy the 3 arginfo
1 parent 6800c93 commit 5766213

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

‎src/php_http_client_curl_user.c‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ static void *php_http_client_curl_user_init(php_http_client_t *client, void *use
178178
php_http_client_curl_user_context_t *ctx;
179179
php_http_object_method_t init;
180180
zval args[1], *zclosure = &args[0];
181+
int i;
181182

182183
#if DBG_EVENTS
183184
fprintf(stderr, "I");
@@ -191,13 +192,15 @@ static void *php_http_client_curl_user_init(php_http_client_t *client, void *use
191192
ctx->closure.common.type = ZEND_INTERNAL_FUNCTION;
192193
ctx->closure.common.function_name = zend_string_init(ZEND_STRL("php_http_client_curl_user_handler"), 0);
193194
ctx->closure.internal_function.handler = php_http_client_curl_user_handler;
194-
ctx->ai.type = ai_user_handler[1].type;
195+
for (i = 0; i < 3; i++) {
196+
ctx->ai[i].type = ai_user_handler[i+1].type;
195197
#if PHP_VERSION_ID < 80600
196-
ctx->ai.name = ai_user_handler[1].name;
198+
ctx->ai[i].name = ai_user_handler[i+1].name;
197199
#else
198-
ctx->ai.name = zend_string_init(ai_user_handler[1].name, strlen(ai_user_handler[1].name), 0);
200+
ctx->ai[i].name = zend_string_init(ai_user_handler[i+1].name, strlen(ai_user_handler[i+1].name), 0);
199201
#endif
200-
ctx->closure.internal_function.arg_info = &ctx->ai;
202+
}
203+
ctx->closure.internal_function.arg_info = ctx->ai;
201204
ctx->closure.internal_function.num_args = 3;
202205
ctx->closure.internal_function.required_num_args = 1;
203206

@@ -227,6 +230,7 @@ static void php_http_client_curl_user_dtor(void **context)
227230
{
228231
php_http_client_curl_user_context_t *ctx = *context;
229232
php_http_client_curl_t *curl;
233+
int i;
230234

231235
#if DBG_EVENTS
232236
fprintf(stderr, "D");
@@ -246,7 +250,9 @@ static void php_http_client_curl_user_dtor(void **context)
246250
php_http_object_method_dtor(&ctx->send);
247251

248252
#if PHP_VERSION_ID >= 80600
249-
zend_string_release(ctx->ai.name);
253+
for (i = 0; i < 3; i++) {
254+
zend_string_release(ctx->ai[i].name);
255+
}
250256
#endif
251257
zend_string_release(ctx->closure.common.function_name);
252258
zval_ptr_dtor(&ctx->user);

‎src/php_http_client_curl_user.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ typedef struct php_http_client_curl_user_context {
2525
php_http_object_method_t wait;
2626
php_http_object_method_t send;
2727
#if PHP_VERSION_ID < 80600
28-
zend_internal_arg_info ai;
28+
zend_internal_arg_info ai[3];
2929
#else
30-
zend_arg_info ai;
30+
zend_arg_info ai[3];
3131
#endif
3232
} php_http_client_curl_user_context_t;
3333

0 commit comments

Comments
 (0)