efree(pool->timeout);
#endif
+ http_request_pool_detach_all(pool);
+
pool->unfinished = 0;
zend_llist_clean(&pool->finished);
zend_llist_clean(&pool->handles);
/* {{{ 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;
}
#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);
msg = curl_multi_info_read(pool->ch, &remaining);
if (msg && CURLMSG_DONE == msg->msg) {
if (CURLE_OK != msg->data.result) {
- http_request *r = NULL;
- curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &r);
- http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s; %s (%s)", curl_easy_strerror(msg->data.result), r?r->_error:"", r?r->url:"");
+ http_request_storage *st = http_request_storage_get(msg->easy_handle);
+ http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s; %s (%s)", curl_easy_strerror(msg->data.result), st?st->errorbuffer:"", st?st->url:"");
}
http_request_pool_apply_with_arg(pool, _http_request_pool_apply_responsehandler, msg->easy_handle);
}