From 2c2292ecaf419756a01fdea83791779ff9f60741 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Mon, 2 Sep 2024 13:29:54 +0200 Subject: [PATCH] haproxy: send though next filter Small but, instead of sending the initial data though the connection method, send it to the next filter in the chain. While the connection methods accomodates for such use, by ignoring unconnected filters, it is better to follow the filter chain explicitly. Closes #14756 --- lib/cf-haproxy.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/cf-haproxy.c b/lib/cf-haproxy.c index 4b59909024..0fc7625c44 100644 --- a/lib/cf-haproxy.c +++ b/lib/cf-haproxy.c @@ -131,17 +131,17 @@ static CURLcode cf_haproxy_connect(struct Curl_cfilter *cf, case HAPROXY_SEND: len = Curl_dyn_len(&ctx->data_out); if(len > 0) { - size_t written; - result = Curl_conn_send(data, cf->sockindex, - Curl_dyn_ptr(&ctx->data_out), - len, FALSE, &written); - if(result == CURLE_AGAIN) { + ssize_t nwritten; + nwritten = Curl_conn_cf_send(cf->next, data, + Curl_dyn_ptr(&ctx->data_out), len, FALSE, + &result); + if(nwritten < 0) { + if(result != CURLE_AGAIN) + goto out; result = CURLE_OK; - written = 0; + nwritten = 0; } - else if(result) - goto out; - Curl_dyn_tail(&ctx->data_out, len - written); + Curl_dyn_tail(&ctx->data_out, len - (size_t)nwritten); if(Curl_dyn_len(&ctx->data_out) > 0) { result = CURLE_OK; goto out;