← Commit list

5e4e62962c

Stefan Eissing
Stefan Eissing
2026-05-20
SUCCESS Duration: 259s

Subject

cfilters: fix busy loop on blocked transfers

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/cfilters.c+13 -2
@@ -889,8 +889,19 @@ CURLcode Curl_conn_adjust_pollset(struct Curl_easy *data,
DEBUGASSERT(data);
DEBUGASSERT(conn);
- for(i = 0; (i < 2) && !result; ++i) {
- result = Curl_conn_cf_adjust_pollset(conn->cfilter[i], data, ps);
+ /* During connect time, connection filters may add sockets to the pollset
+ * even when the transfer neither wants to send nor receive. And those
+ * sockets, when having events, are served.
+ * Once connected however, a transfer that neither wants to send nor receive
+ * will never call the connection filters. Any sockets added by the filters
+ * will not change state and POLLIN/POLLOUT events will trigger forever,
+ * making us busy loop. See #21671 */
+ if(ps->n || !Curl_conn_is_connected(conn, FIRSTSOCKET) ||
+ (conn->cfilter[SECONDARYSOCKET] &&
+ !Curl_conn_is_connected(conn, SECONDARYSOCKET))) {
+ for(i = 0; (i < 2) && !result && conn; ++i) {
+ result = Curl_conn_cf_adjust_pollset(conn->cfilter[i], data, ps);
+ }
}
return result;
}