summaryrefslogtreecommitdiff
path: root/lib/cfilters.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-12-26 09:59:20 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-12-27 10:48:29 +0100
commit728400f875e845f72ee5602edb905f6301ade3e7 (patch)
tree8ac5dd9456958e94f410ffe648acb8c69c547eeb /lib/cfilters.c
parent901392cbb7939f43b7e7ed2b39135b45416a2714 (diff)
downloadcurl-728400f875e845f72ee5602edb905f6301ade3e7.tar.gz
cfilters:Curl_conn_get_select_socks: use the first non-connected filter
When there are filters addded for both socket and SSL, the code previously checked the SSL sockets during connect when it *should* first check the socket layer until that has connected. Fixes #10157 Fixes #10146 Closes #10160 Reviewed-by: Stefan Eissing
Diffstat (limited to 'lib/cfilters.c')
-rw-r--r--lib/cfilters.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/cfilters.c b/lib/cfilters.c
index 895153341..8b05fbc8f 100644
--- a/lib/cfilters.c
+++ b/lib/cfilters.c
@@ -437,6 +437,10 @@ int Curl_conn_get_select_socks(struct Curl_easy *data, int sockindex,
DEBUGASSERT(data);
DEBUGASSERT(data->conn);
cf = data->conn->cfilter[sockindex];
+
+ /* if the next one is not yet connected, that's the one we want */
+ while(cf && cf->next && !cf->next->connected)
+ cf = cf->next;
if(cf) {
return cf->cft->get_select_socks(cf, data, socks);
}