X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_pool_api.c;h=fcc015ea8692dca4486d64134f22c40ab058d8fa;hp=e5482b41da4778dc90661b82b11f59c01fd3f262;hb=d982551f5260407a6301c662604ac0b854fb7ba0;hpb=d98b2e7cdf369bf32149aa62484e576c02d4c67b diff --git a/http_request_pool_api.c b/http_request_pool_api.c index e5482b4..fcc015e 100644 --- a/http_request_pool_api.c +++ b/http_request_pool_api.c @@ -316,6 +316,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 +336,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);