diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-11-02 17:34:04 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-11-02 17:34:04 +0100 |
commit | f5341d0dfa0f1ba98b0f9306ae6cb985258af2ed (patch) | |
tree | 54bb308146bdbd9e8da1fd228b8757967ac8014e /lib/vssh/libssh2.c | |
parent | 606d213766fb94a4653ec41ef3b91cc0a96b9570 (diff) | |
download | curl-bagder/debug-verbose-check.tar.gz |
sendf: move the verbose-check into Curl_debugbagder/debug-verbose-check
Saves us from having the same check done everywhere.
Diffstat (limited to 'lib/vssh/libssh2.c')
-rw-r--r-- | lib/vssh/libssh2.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index fbadb246e..fbcf971b3 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -1343,10 +1343,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) sshc->nextstate = SSH_NO_STATE; break; } - if(data->set.verbose) { - Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"PWD\n", 4); - Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp)); - } + Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"PWD\n", 4); + Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp)); + /* this sends an FTP-like "header" to the header callback so that the current directory can be read very similar to how it is read when using ordinary FTP. */ @@ -2167,11 +2166,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) data->req.bytecount += readdir_len + 1; /* output debug output if that is requested */ - if(data->set.verbose) { - Curl_debug(data, CURLINFO_DATA_IN, sshc->readdir_filename, - readdir_len); - Curl_debug(data, CURLINFO_DATA_IN, (char *)"\n", 1); - } + Curl_debug(data, CURLINFO_DATA_IN, sshc->readdir_filename, + readdir_len); + Curl_debug(data, CURLINFO_DATA_IN, (char *)"\n", 1); } else { result = Curl_dyn_add(&sshc->readdir, sshc->readdir_longentry); @@ -2252,13 +2249,10 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) Curl_dyn_len(&sshc->readdir)); if(!result) { - /* output debug output if that is requested */ - if(data->set.verbose) { - Curl_debug(data, CURLINFO_DATA_IN, - Curl_dyn_ptr(&sshc->readdir), - Curl_dyn_len(&sshc->readdir)); - } + Curl_debug(data, CURLINFO_DATA_IN, + Curl_dyn_ptr(&sshc->readdir), + Curl_dyn_len(&sshc->readdir)); data->req.bytecount += Curl_dyn_len(&sshc->readdir); } if(result) { @@ -3037,8 +3031,7 @@ static ssize_t ssh_tls_recv(libssh2_socket_t sock, void *buffer, return -EAGAIN; /* magic return code for libssh2 */ else if(result) return -1; /* generic error */ - if(conn->data->set.verbose) - Curl_debug(conn->data, CURLINFO_DATA_IN, (char *)buffer, (size_t)nread); + Curl_debug(conn->data, CURLINFO_DATA_IN, (char *)buffer, (size_t)nread); return nread; } @@ -3061,8 +3054,7 @@ static ssize_t ssh_tls_send(libssh2_socket_t sock, const void *buffer, return -EAGAIN; /* magic return code for libssh2 */ else if(result) return -1; /* error */ - if(conn->data->set.verbose) - Curl_debug(conn->data, CURLINFO_DATA_OUT, (char *)buffer, (size_t)nwrite); + Curl_debug(conn->data, CURLINFO_DATA_OUT, (char *)buffer, (size_t)nwrite); return nwrite; } #endif |