diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-09-23 09:22:02 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-09-23 15:14:09 +0200 |
commit | 675eeb1c941706070381faaad8ee1a5d75cff4a4 (patch) | |
tree | 180f01d716fa508c45cea533973782817d980c5c /lib/smtp.c | |
parent | f74afa40f8b6b87ccf74a4ca70b5514a9a87e6f1 (diff) | |
download | curl-675eeb1c941706070381faaad8ee1a5d75cff4a4.tar.gz |
pingpong: use a dynbuf for the *_pp_sendf() function
... reuses the same dynamic buffer instead of doing repeated malloc/free
cycles.
Test case 100 (FTP dir list PASV) does 7 fewer memory allocation calls
after this change in my test setup (132 => 125), curl 7.72.0 needed 140
calls for this.
Test case 103 makes 9 less allocations now (130). Down from 149 in
7.72.0.
Closes #6004
Diffstat (limited to 'lib/smtp.c')
-rw-r--r-- | lib/smtp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index c2d632322..49743c036 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1324,6 +1324,7 @@ static CURLcode smtp_connect(struct connectdata *conn, bool *done) Curl_sasl_init(&smtpc->sasl, &saslsmtp); /* Initialise the pingpong layer */ + Curl_pp_setup(pp); Curl_pp_init(pp); /* Parse the URL options */ |