X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_client_curl.c;fp=php_http_client_curl.c;h=3ee624eb1d20d90f69fa5f1f4a5b255d8ab6fbde;hp=b261a34112b4f93a0f1f78d5828b135fa585d037;hb=0fec4ae3ad609adc395f7c5abbc6472792d03514;hpb=8e1a8dc794800b079df0ee108fc72b9bd8ddfdee diff --git a/php_http_client_curl.c b/php_http_client_curl.c index b261a34..3ee624e 100644 --- a/php_http_client_curl.c +++ b/php_http_client_curl.c @@ -1675,10 +1675,8 @@ static STATUS php_http_client_curl_handler_prepare(php_http_client_curl_handler_ return SUCCESS; } -static void php_http_client_curl_handler_dtor(php_http_client_curl_handler_t *handler) +static void php_http_client_curl_handler_clear(php_http_client_curl_handler_t *handler) { - TSRMLS_FETCH_FROM_CTX(handler->client->ts); - curl_easy_setopt(handler->handle, CURLOPT_NOPROGRESS, 1L); #if PHP_HTTP_CURL_VERSION(7,32,0) curl_easy_setopt(handler->handle, CURLOPT_XFERINFOFUNCTION, NULL); @@ -1687,6 +1685,13 @@ static void php_http_client_curl_handler_dtor(php_http_client_curl_handler_t *ha #endif curl_easy_setopt(handler->handle, CURLOPT_VERBOSE, 0L); curl_easy_setopt(handler->handle, CURLOPT_DEBUGFUNCTION, NULL); +} + +static void php_http_client_curl_handler_dtor(php_http_client_curl_handler_t *handler) +{ + TSRMLS_FETCH_FROM_CTX(handler->client->ts); + + php_http_client_curl_handler_clear(handler); php_resource_factory_handle_dtor(handler->rf, handler->handle TSRMLS_CC); php_resource_factory_free(&handler->rf); @@ -1851,6 +1856,7 @@ static STATUS php_http_client_curl_dequeue(php_http_client_t *h, php_http_client php_http_client_curl_handler_t *handler = enqueue->opaque; TSRMLS_FETCH_FROM_CTX(h->ts); + php_http_client_curl_handler_clear(handler); if (CURLM_OK == (rs = curl_multi_remove_handle(curl->handle, handler->handle))) { zend_llist_del_element(&h->requests, handler->handle, (int (*)(void *, void *)) compare_queue); return SUCCESS;