X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_curl_client_pool.c;h=4edff74e99341166225dd26056bc13a46616c9d8;hp=6ae1da658ae99886433b3fb347fa106ee1fd749a;hb=8df0e5b02cd04b43f19045c0f4f69c4076840d27;hpb=d5de4f9eae86ae1dab0f8a906bf9543710ae124d diff --git a/php_http_curl_client_pool.c b/php_http_curl_client_pool.c index 6ae1da6..4edff74 100644 --- a/php_http_curl_client_pool.c +++ b/php_http_curl_client_pool.c @@ -62,7 +62,7 @@ static void php_http_curl_client_pool_responsehandler(php_http_client_pool_t *po zval **request; if (CURLE_OK != msg->data.result) { - php_http_curl_client_storage_t *st = get_storage(msg->easy_handle); + php_http_curl_client_storage_t *st = php_http_curl_client_get_storage(msg->easy_handle); php_http_error(HE_WARNING, PHP_HTTP_E_CLIENT, "%s; %s (%s)", curl_easy_strerror(msg->data.result), STR_PTR(st->errorbuffer), STR_PTR(st->url)); } @@ -556,16 +556,26 @@ PHP_MINIT_FUNCTION(http_curl_client_pool) return SUCCESS; } +#if PHP_HTTP_HAVE_EVENT PHP_RINIT_FUNCTION(http_curl_client_pool) { -#if PHP_HTTP_HAVE_EVENT if (!PHP_HTTP_G->curl.event_base && !(PHP_HTTP_G->curl.event_base = event_base_new())) { return FAILURE; } + return SUCCESS; +} #endif +#if PHP_HTTP_HAVE_EVENT +PHP_RSHUTDOWN_FUNCTION(http_curl_client_pool) +{ + if (PHP_HTTP_G->curl.event_base) { + event_base_free(PHP_HTTP_G->curl.event_base); + PHP_HTTP_G->curl.event_base = NULL; + } return SUCCESS; } +#endif #endif /* PHP_HTTP_HAVE_CURL */