From: Michael Wallner Date: Mon, 15 Sep 2014 11:51:03 +0000 (+0200) Subject: Fixed bug #68009 X-Git-Tag: RELEASE_2_1_2~5 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=ec2582a8084352a9224543ee43fbd060c1ea4d6c;p=m6w6%2Fext-http Fixed bug #68009 the progress handler fired while in the mid of executor shutdown --- diff --git a/package.xml b/package.xml index f924dea..eb7642d 100644 --- a/package.xml +++ b/package.xml @@ -48,8 +48,7 @@ v2: http://dev.iworks.at/ext-http/lcov/ext/http/ BSD, revised diff --git a/php_http_client_curl.c b/php_http_client_curl.c index db73a31..20bbf8e 100644 --- a/php_http_client_curl.c +++ b/php_http_client_curl.c @@ -1677,10 +1677,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); @@ -1689,6 +1687,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); @@ -1853,6 +1858,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;