diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-11-23 08:32:41 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-11-23 16:16:16 +0100 |
commit | a95a6ce6b809693a1195e3b4347a6cfa0fbc2ee7 (patch) | |
tree | 5f0b777ade4540e7c622b6ad2d2126d920dafa6b /lib/vssh | |
parent | 5c8849cede5577b8b23c3b1d75c03923ce034061 (diff) | |
download | curl-a95a6ce6b809693a1195e3b4347a6cfa0fbc2ee7.tar.gz |
urldata: remove 'void *protop' and create the union 'p'
... to avoid the use of 'void *' for the protocol specific structs done
per transfer.
Closes #6238
Diffstat (limited to 'lib/vssh')
-rw-r--r-- | lib/vssh/libssh.c | 10 | ||||
-rw-r--r-- | lib/vssh/libssh2.c | 8 | ||||
-rw-r--r-- | lib/vssh/wolfssh.c | 8 |
3 files changed, 13 insertions, 13 deletions
diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 8c0a567a7..e79d8e823 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -664,7 +664,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SSHPROTO *protop = data->req.protop; + struct SSHPROTO *protop = data->req.p.ssh; struct ssh_conn *sshc = &conn->proto.sshc; curl_socket_t sock = conn->sock[FIRSTSOCKET]; int rc = SSH_NO_ERROR, err; @@ -2125,7 +2125,7 @@ static CURLcode myssh_setup_connection(struct connectdata *conn) { struct SSHPROTO *ssh; - conn->data->req.protop = ssh = calloc(1, sizeof(struct SSHPROTO)); + conn->data->req.p.ssh = ssh = calloc(1, sizeof(struct SSHPROTO)); if(!ssh) return CURLE_OUT_OF_MEMORY; @@ -2148,7 +2148,7 @@ static CURLcode myssh_connect(struct connectdata *conn, bool *done) int rc; /* initialize per-handle data if not already */ - if(!data->req.protop) + if(!data->req.p.ssh) myssh_setup_connection(conn); /* We default to persistent connections. We set this already in this connect @@ -2349,7 +2349,7 @@ static CURLcode scp_disconnect(struct connectdata *conn, static CURLcode myssh_done(struct connectdata *conn, CURLcode status) { CURLcode result = CURLE_OK; - struct SSHPROTO *protop = conn->data->req.protop; + struct SSHPROTO *protop = conn->data->req.p.ssh; if(!status) { /* run the state-machine */ @@ -2602,7 +2602,7 @@ static void sftp_quote(struct connectdata *conn) { const char *cp; struct Curl_easy *data = conn->data; - struct SSHPROTO *protop = data->req.protop; + struct SSHPROTO *protop = data->req.p.ssh; struct ssh_conn *sshc = &conn->proto.sshc; CURLcode result; diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 4b60cef8b..aee9a8a67 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -798,7 +798,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SSHPROTO *sftp_scp = data->req.protop; + struct SSHPROTO *sftp_scp = data->req.p.ssh; struct ssh_conn *sshc = &conn->proto.sshc; curl_socket_t sock = conn->sock[FIRSTSOCKET]; int rc = LIBSSH2_ERROR_NONE; @@ -3001,7 +3001,7 @@ static CURLcode ssh_setup_connection(struct connectdata *conn) { struct SSHPROTO *ssh; - conn->data->req.protop = ssh = calloc(1, sizeof(struct SSHPROTO)); + conn->data->req.p.ssh = ssh = calloc(1, sizeof(struct SSHPROTO)); if(!ssh) return CURLE_OUT_OF_MEMORY; @@ -3073,7 +3073,7 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done) struct Curl_easy *data = conn->data; /* initialize per-handle data if not already */ - if(!data->req.protop) + if(!data->req.p.ssh) ssh_setup_connection(conn); /* We default to persistent connections. We set this already in this connect @@ -3299,7 +3299,7 @@ static CURLcode scp_disconnect(struct connectdata *conn, bool dead_connection) static CURLcode ssh_done(struct connectdata *conn, CURLcode status) { CURLcode result = CURLE_OK; - struct SSHPROTO *sftp_scp = conn->data->req.protop; + struct SSHPROTO *sftp_scp = conn->data->req.p.ssh; if(!status) { /* run the state-machine */ diff --git a/lib/vssh/wolfssh.c b/lib/vssh/wolfssh.c index ec1e90680..b0dfb2047 100644 --- a/lib/vssh/wolfssh.c +++ b/lib/vssh/wolfssh.c @@ -322,7 +322,7 @@ static CURLcode wssh_setup_connection(struct connectdata *conn) { struct SSHPROTO *ssh; - conn->data->req.protop = ssh = calloc(1, sizeof(struct SSHPROTO)); + conn->data->req.p.ssh = ssh = calloc(1, sizeof(struct SSHPROTO)); if(!ssh) return CURLE_OUT_OF_MEMORY; @@ -356,7 +356,7 @@ static CURLcode wssh_connect(struct connectdata *conn, bool *done) int rc; /* initialize per-handle data if not already */ - if(!data->req.protop) + if(!data->req.p.ssh) wssh_setup_connection(conn); /* We default to persistent connections. We set this already in this connect @@ -429,7 +429,7 @@ static CURLcode wssh_statemach_act(struct connectdata *conn, bool *block) CURLcode result = CURLE_OK; struct ssh_conn *sshc = &conn->proto.sshc; struct Curl_easy *data = conn->data; - struct SSHPROTO *sftp_scp = data->req.protop; + struct SSHPROTO *sftp_scp = data->req.p.ssh; WS_SFTPNAME *name; int rc = 0; *block = FALSE; /* we're not blocking by default */ @@ -1027,7 +1027,7 @@ static CURLcode wssh_block_statemach(struct connectdata *conn, static CURLcode wssh_done(struct connectdata *conn, CURLcode status) { CURLcode result = CURLE_OK; - struct SSHPROTO *sftp_scp = conn->data->req.protop; + struct SSHPROTO *sftp_scp = conn->data->req.p.ssh; if(!status) { /* run the state-machine */ |