cfilters: make conn_forget_socket a private libssh function

It is only used for (old) libssh builds.

Closes #19727
This commit is contained in:
Daniel Stenberg 2025-11-27 14:25:43 +01:00
parent c8b76ff42f
commit a59a3cc7f1
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 14 additions and 14 deletions

View file

@ -931,19 +931,6 @@ Curl_conn_get_remote_addr(struct Curl_easy *data, int sockindex)
return cf ? cf_get_remote_addr(cf, data) : NULL;
}
void Curl_conn_forget_socket(struct Curl_easy *data, int sockindex)
{
struct connectdata *conn = data->conn;
if(conn && CONN_SOCK_IDX_VALID(sockindex)) {
struct Curl_cfilter *cf = conn->cfilter[sockindex];
if(cf)
(void)Curl_conn_cf_cntrl(cf, data, TRUE,
CF_CTRL_FORGET_SOCKET, 0, NULL);
fake_sclose(conn->sock[sockindex]);
conn->sock[sockindex] = CURL_SOCKET_BAD;
}
}
static CURLcode cf_cntrl_all(struct connectdata *conn,
struct Curl_easy *data,
bool ignore_result,

View file

@ -1874,6 +1874,19 @@ static int myssh_in_SFTP_QUOTE_STAT(struct Curl_easy *data,
return SSH_NO_ERROR;
}
static void conn_forget_socket(struct Curl_easy *data, int sockindex)
{
struct connectdata *conn = data->conn;
if(conn && CONN_SOCK_IDX_VALID(sockindex)) {
struct Curl_cfilter *cf = conn->cfilter[sockindex];
if(cf)
(void)Curl_conn_cf_cntrl(cf, data, TRUE,
CF_CTRL_FORGET_SOCKET, 0, NULL);
fake_sclose(conn->sock[sockindex]);
conn->sock[sockindex] = CURL_SOCKET_BAD;
}
}
/*
* ssh_statemach_act() runs the SSH state machine as far as it can without
* blocking and without reaching the end. The data the pointer 'block' points
@ -2376,7 +2389,7 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data,
/* conn->sock[FIRSTSOCKET] is closed by ssh_disconnect behind our back,
tell the connection to forget about it. This libssh
bug is fixed in 0.10.0. */
Curl_conn_forget_socket(data, FIRSTSOCKET);
conn_forget_socket(data, FIRSTSOCKET);
}
SSH_STRING_FREE_CHAR(sshc->homedir);