summaryrefslogtreecommitdiff
path: root/lib/vssh/ssh.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-05-04 14:44:07 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-05-05 14:54:07 +0200
commit44645ca8b0d083f035d815d1cca1fb2a94d191db (patch)
treee0ec5b17783f55d1225d8d7f0bcce8ad4d6ec9ef /lib/vssh/ssh.h
parent881006465573e8a29eef93ce44f2fa249ef2feb4 (diff)
downloadcurl-44645ca8b0d083f035d815d1cca1fb2a94d191db.tar.gz
libssh2: convert over to use dynbuf
In my very basic test that lists sftp://127.0.0.1/tmp/, this patched code makes 161 allocations compared to 194 in git master. A 17% reduction. Closes #5336
Diffstat (limited to 'lib/vssh/ssh.h')
-rw-r--r--lib/vssh/ssh.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/vssh/ssh.h b/lib/vssh/ssh.h
index 0d4ee521d..9e49993e9 100644
--- a/lib/vssh/ssh.h
+++ b/lib/vssh/ssh.h
@@ -134,9 +134,7 @@ struct ssh_conn {
quote command fails) */
char *homedir; /* when doing SFTP we figure out home dir in the
connect phase */
- size_t readdir_len, readdir_totalLen, readdir_currLen;
char *readdir_line;
- char *readdir_linkPath;
/* end of READDIR stuff */
int secondCreateDirs; /* counter use by the code to see if the
@@ -147,6 +145,8 @@ struct ssh_conn {
int orig_waitfor; /* default READ/WRITE bits wait for */
#if defined(USE_LIBSSH)
+ char *readdir_linkPath;
+ size_t readdir_len, readdir_totalLen, readdir_currLen;
/* our variables */
unsigned kbd_state; /* 0 or 1 */
ssh_key privkey;
@@ -168,6 +168,8 @@ struct ssh_conn {
const char *readdir_longentry;
char *readdir_tmp;
#elif defined(USE_LIBSSH2)
+ struct dynbuf readdir_link;
+ struct dynbuf readdir;
char *readdir_filename;
char *readdir_longentry;