+/* {{{ static void http_request_pool_update_timeout(http_request_pool *) */
+static inline void http_request_pool_update_timeout(http_request_pool *pool)
+{
+ struct timeval timeout;
+ TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
+
+ if (event_initialized(pool->timeout)) {
+ event_del(pool->timeout);
+ }
+
+ if (pool->unfinished) {
+ 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, http_request_pool_timeout(pool, &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
+ }
+#if HTTP_DEBUG_REQPOOLS
+ else fprintf(stderr, "Removed timeout of pool %p\n", pool);
+#endif
+}
+/* }}} */
+
+/* {{{ static void http_request_pool_timeout_callback(int, short, void *) */
+static void http_request_pool_timeout_callback(int socket, short action, void *event_data)