X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_pool_api.c;h=d1d76c31e17f7eb405f36b9254f03b75a789d658;hp=e5482b41da4778dc90661b82b11f59c01fd3f262;hb=984c41f4ca1654cc013d8867d6546bb5ac2fcd61;hpb=d8d4c50ac3637c4fafae5cec91501795b334c11e diff --git a/http_request_pool_api.c b/http_request_pool_api.c index e5482b4..d1d76c3 100644 --- a/http_request_pool_api.c +++ b/http_request_pool_api.c @@ -301,6 +301,8 @@ PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool) efree(pool->timeout); #endif + http_request_pool_detach_all(pool); + pool->unfinished = 0; zend_llist_clean(&pool->finished); zend_llist_clean(&pool->handles); @@ -316,6 +318,13 @@ PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool) /* {{{ STATUS http_request_pool_select(http_request_pool *) */ PHP_HTTP_API STATUS _http_request_pool_select(http_request_pool *pool) +{ + return http_request_pool_select_ex(pool, NULL); +} +/* }}} */ + +/* {{{ STATUS http_request_pool_select_ex(http_request_pool *, struct timeval *) */ +PHP_HTTP_API STATUS _http_request_pool_select_ex(http_request_pool *pool, struct timeval *custom_timeout) { int MAX; fd_set R, W, E; @@ -329,7 +338,11 @@ PHP_HTTP_API STATUS _http_request_pool_select(http_request_pool *pool) } #endif - http_request_pool_timeout(pool, &timeout); + if (custom_timeout && timerisset(custom_timeout)) { + timeout = *custom_timeout; + } else { + http_request_pool_timeout(pool, &timeout); + } FD_ZERO(&R); FD_ZERO(&W);