lib: xfer_setup simplify

Make variants for transfers that send/receive or do both with just the
parameters they need. Split out the shutdown setting into a separate
function. Only FTP bothers with that.

Closes #18203
This commit is contained in:
Stefan Eissing 2025-08-06 11:56:08 +02:00 committed by Daniel Stenberg
parent 034612cd51
commit 6cebd35b4c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
15 changed files with 104 additions and 109 deletions

View file

@ -717,7 +717,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data,
Curl_pgrsSetUploadSize(data, data->state.infilesize);
}
/* upload data */
Curl_xfer_setup1(data, CURL_XFER_SEND, -1, FALSE);
Curl_xfer_setup_send(data, FIRSTSOCKET);
/* not set by Curl_xfer_setup to preserve keepon bits */
data->conn->recv_idx = FIRSTSOCKET;
@ -816,7 +816,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data,
wssh_state(data, sshc, SSH_STOP);
break;
}
Curl_xfer_setup1(data, CURL_XFER_RECV, data->req.size, FALSE);
Curl_xfer_setup_recv(data, FIRSTSOCKET, data->req.size, FALSE);
/* not set by Curl_xfer_setup to preserve keepon bits */
conn->send_idx = 0;