mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:23:32 +03:00
lib: replace conn [write]sockfd members by index
The `connectdata` members `sockfd` and `writesockfd` needed to by either CURL_SOCKET_BAD or a copy of one of `conn->sock[2]`. When equal to one, that index was used to send/recv/poll the proper socket or connection filter chain. Replace those with `send_idx` and `recv_idx` which are either -1, 0 or 1 to indicate which socket/filter to send/receive on. Closes #18179
This commit is contained in:
parent
aec28f3ad3
commit
6d5570c4dd
9 changed files with 120 additions and 92 deletions
|
|
@ -720,7 +720,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data,
|
|||
Curl_xfer_setup1(data, CURL_XFER_SEND, -1, FALSE);
|
||||
|
||||
/* not set by Curl_xfer_setup to preserve keepon bits */
|
||||
conn->sockfd = conn->writesockfd;
|
||||
data->conn->recv_idx = FIRSTSOCKET;
|
||||
|
||||
if(result) {
|
||||
wssh_state(data, sshc, SSH_SFTP_CLOSE);
|
||||
|
|
@ -819,7 +819,7 @@ static CURLcode wssh_statemach_act(struct Curl_easy *data,
|
|||
Curl_xfer_setup1(data, CURL_XFER_RECV, data->req.size, FALSE);
|
||||
|
||||
/* not set by Curl_xfer_setup to preserve keepon bits */
|
||||
conn->writesockfd = conn->sockfd;
|
||||
conn->send_idx = 0;
|
||||
|
||||
if(result) {
|
||||
/* this should never occur; the close state should be entered
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue