From: Stefan Eissing Date: Mon, 2 Sep 2024 11:29:54 +0000 (+0200) Subject: haproxy: send though next filter X-Git-Tag: curl-8_10_0~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c2292ecaf419756a01fdea83791779ff9f60741;p=thirdparty%2Fcurl.git 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 --- 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;