+/* }}} */
+
+/* {{{ static void http_request_pool_timer_callback(CURLM *, long, void*) */
+static void http_request_pool_timer_callback(CURLM *multi, long timeout_ms, void *timer_data)
+{
+ http_request_pool *pool = timer_data;
+
+ if (pool->useevents) {
+ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
+ struct timeval timeout = {timeout_ms / 1000, (timeout_ms % 1000) * 1000};
+
+ if (event_initialized(pool->timeout) && event_pending(pool->timeout, EV_TIMEOUT, NULL)) {
+ event_del(pool->timeout);
+ }
+
+ event_set(pool->timeout, -1, 0, http_request_pool_timeout_callback, pool);
+ event_base_set(HTTP_G->request.pool.event.base, pool->timeout);
+ event_add(pool->timeout, &timeout);
+
+#if HTTP_DEBUG_REQPOOLS
+ fprintf(stderr, "Updating timeout (%lu, %lu) of pool %p\n", (ulong) timeout.tv_sec, (ulong) timeout.tv_usec, pool);
+#endif
+ }
+}
+/* }}} */