mirror of
https://github.com/curl/curl.git
synced 2025-03-07 15:27:17 +08:00
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
This commit is contained in:
parent
e512fbfa67
commit
2c2292ecaf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user