@@ -261,6 +261,9 @@ void swoole_native_curl_minit(int module_number) {
261
261
}
262
262
swoole_coroutine_curl_handle_ce = curl_ce;
263
263
swoole_coroutine_curl_handle_ce->create_object = swoole_curl_create_object;
264
+ #if PHP_VERSION_ID >= 80300
265
+ swoole_coroutine_curl_handle_ce->default_object_handlers = &swoole_coroutine_curl_handle_handlers;
266
+ #endif
264
267
memcpy (&swoole_coroutine_curl_handle_handlers, &std_object_handlers, sizeof (zend_object_handlers));
265
268
swoole_coroutine_curl_handle_handlers.offset = XtOffsetOf (php_curl, std);
266
269
swoole_coroutine_curl_handle_handlers.free_obj = swoole_curl_free_obj;
@@ -274,7 +277,7 @@ void swoole_native_curl_minit(int module_number) {
274
277
275
278
zend_declare_property_null (swoole_coroutine_curl_handle_ce, ZEND_STRL (" private_data" ), ZEND_ACC_PUBLIC);
276
279
277
- curl_multi_register_class ( nullptr );
280
+ swoole_curl_multi_register_handlers ( );
278
281
279
282
zend_unregister_functions (swoole_native_curl_functions, -1 , CG (function_table));
280
283
zend_register_functions (NULL , swoole_native_curl_functions, NULL , MODULE_PERSISTENT);
@@ -293,7 +296,9 @@ static zend_object *swoole_curl_create_object(zend_class_entry *class_type) {
293
296
294
297
zend_object_std_init (&intern->std , class_type);
295
298
object_properties_init (&intern->std , class_type);
299
+ #if PHP_VERSION_ID < 80300
296
300
intern->std .handlers = &swoole_coroutine_curl_handle_handlers;
301
+ #endif
297
302
298
303
return &intern->std ;
299
304
}
@@ -907,10 +912,6 @@ void swoole_curl_init_handle(php_curl *ch) {
907
912
zend_llist_init (&ch->to_free ->post , sizeof (struct HttpPost *), (llist_dtor_func_t ) curl_free_post, 0 );
908
913
zend_llist_init (&ch->to_free ->stream , sizeof (struct mime_data_cb_arg *), (llist_dtor_func_t ) curl_free_cb_arg, 0 );
909
914
910
- #if LIBCURL_VERSION_NUM < 0x073800 && PHP_VERSION_ID >= 80100
911
- zend_llist_init (&ch->to_free ->buffers , sizeof (zend_string *), (llist_dtor_func_t )curl_free_buffers, 0 );
912
- #endif
913
-
914
915
ch->to_free ->slist = (HashTable *) emalloc (sizeof (HashTable));
915
916
zend_hash_init (ch->to_free ->slist , 4 , NULL , curl_free_slist, 0 );
916
917
ZVAL_UNDEF (&ch->postfields );
@@ -2444,10 +2445,6 @@ static void _php_curl_free(php_curl *ch) {
2444
2445
if (--(*ch->clone ) == 0 ) {
2445
2446
#if PHP_VERSION_ID < 80100
2446
2447
zend_llist_clean (&ch->to_free ->str );
2447
- #else
2448
- #if LIBCURL_VERSION_NUM < 0x073800 /* 7.56.0 */
2449
- zend_llist_clean (&ch->to_free ->buffers );
2450
- #endif
2451
2448
#endif
2452
2449
zend_llist_clean (&ch->to_free ->post );
2453
2450
zend_llist_clean (&ch->to_free ->stream );
0 commit comments