mirror of
https://github.com/curl/curl.git
synced 2026-08-06 11:16:15 +03:00
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
This commit is contained in:
parent
8810064655
commit
44645ca8b0
2 changed files with 55 additions and 77 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue