mirror of
https://github.com/curl/curl.git
synced 2026-07-24 16:47:16 +03:00
lib: reduce variable scopes
Fixes Codacy/CppCheck warnings. Closes https://github.com/curl/curl/pull/3872
This commit is contained in:
parent
27af2ec219
commit
10db3ef21e
23 changed files with 115 additions and 124 deletions
|
|
@ -1946,14 +1946,13 @@ static int myssh_getsock(struct connectdata *conn,
|
|||
static void myssh_block2waitfor(struct connectdata *conn, bool block)
|
||||
{
|
||||
struct ssh_conn *sshc = &conn->proto.sshc;
|
||||
int dir;
|
||||
|
||||
/* If it didn't block, or nothing was returned by ssh_get_poll_flags
|
||||
* have the original set */
|
||||
conn->waitfor = sshc->orig_waitfor;
|
||||
|
||||
if(block) {
|
||||
dir = ssh_get_poll_flags(sshc->ssh_session);
|
||||
int dir = ssh_get_poll_flags(sshc->ssh_session);
|
||||
if(dir & SSH_READ_PENDING) {
|
||||
/* translate the libssh define bits into our own bit defines */
|
||||
conn->waitfor = KEEP_RECV;
|
||||
|
|
@ -2050,7 +2049,6 @@ static CURLcode myssh_connect(struct connectdata *conn, bool *done)
|
|||
CURLcode result;
|
||||
curl_socket_t sock = conn->sock[FIRSTSOCKET];
|
||||
struct Curl_easy *data = conn->data;
|
||||
int rc;
|
||||
|
||||
/* initialize per-handle data if not already */
|
||||
if(!data->req.protop)
|
||||
|
|
@ -2104,8 +2102,8 @@ static CURLcode myssh_connect(struct connectdata *conn, bool *done)
|
|||
ssh->pubkey = NULL;
|
||||
|
||||
if(data->set.str[STRING_SSH_PUBLIC_KEY]) {
|
||||
rc = ssh_pki_import_pubkey_file(data->set.str[STRING_SSH_PUBLIC_KEY],
|
||||
&ssh->pubkey);
|
||||
int rc = ssh_pki_import_pubkey_file(data->set.str[STRING_SSH_PUBLIC_KEY],
|
||||
&ssh->pubkey);
|
||||
if(rc != SSH_OK) {
|
||||
failf(data, "Could not load public key file");
|
||||
/* ignore */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue