would already have been cleaned up when reaching curl_multi_remove_handle()
when there's no additional reference to the request object (i.e. no user space
reference to the attached request object);
e.g.: $pool = new HttpRequestPool(new HttpRequest('...'))
#include "php_http_requestpool_object.h"
#ifndef HTTP_DEBUG_REQPOOLS
#include "php_http_requestpool_object.h"
#ifndef HTTP_DEBUG_REQPOOLS
-# define HTTP_DEBUG_REQPOOLS 0
+# define HTTP_DEBUG_REQPOOLS 1
#endif
ZEND_EXTERN_MODULE_GLOBALS(http);
#endif
ZEND_EXTERN_MODULE_GLOBALS(http);
- req->pool = NULL;
- zend_llist_del_element(&pool->handles, request, http_request_pool_compare_handles);
- zend_llist_del_element(&pool->finished, request, http_request_pool_compare_handles);
-
+ if (CURLM_OK == (code = curl_multi_remove_handle(pool->ch, req->ch))) {
+ req->pool = NULL;
+ zend_llist_del_element(&pool->handles, request, http_request_pool_compare_handles);
+ zend_llist_del_element(&pool->finished, request, http_request_pool_compare_handles);
+
- fprintf(stderr, "> %d HttpRequests remaining in pool %p\n", zend_llist_count(&pool->handles), pool);
+ fprintf(stderr, "> %d HttpRequests remaining in pool %p\n", zend_llist_count(&pool->handles), pool);
- if (CURLM_OK != (code = curl_multi_remove_handle(pool->ch, req->ch))) {
- http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "Could not detach HttpRequest object from the HttpRequestPool: %s", curl_multi_strerror(code));
- } else {
+ } else {
+ http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "Could not detach HttpRequest object from the HttpRequestPool: %s", curl_multi_strerror(code));
<notes><![CDATA[
+ Classes HttpMessage and HttpRequestPool implement Countable if PHP >= 5.1 with SPL is available
+ Class HttpMessage implements Serializable if PHP >= 5.1 is available
<notes><![CDATA[
+ Classes HttpMessage and HttpRequestPool implement Countable if PHP >= 5.1 with SPL is available
+ Class HttpMessage implements Serializable if PHP >= 5.1 is available
+
+* Fixed a bug that caused a warning about an invalid curl handle at HttpRequestPool destruction
]]></notes>
<contents>
<dir name="/">
]]></notes>
<contents>
<dir name="/">