- return pool->unfinished;
-}
-/* }}} */
-
-/* {{{ STATUS http_request_pool_requesthandler(zval *, http_request_body *) */
-STATUS _http_request_pool_requesthandler(zval *request, http_request_body *body TSRMLS_DC)
-{
- getObjectEx(http_request_object, req, request);
- if (SUCCESS == http_request_object_requesthandler(req, request, body)) {
- http_request_conv(req->ch, &req->response, &req->request);
- return SUCCESS;
+
+ while ((msg = curl_multi_info_read(pool->ch, &remaining))) {
+ if (CURLMSG_DONE == msg->msg) {
+ if (CURLE_OK != msg->data.result) {
+ http_request_pool_try {
+ 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_pool_catch();
+ }
+ http_request_pool_try {
+ zend_llist_apply_with_argument(&pool->handles, (llist_apply_with_arg_func_t) http_request_pool_responsehandler, msg->easy_handle TSRMLS_CC);
+ } http_request_pool_catch();
+ }