summaryrefslogtreecommitdiff
path: root/lib/smtp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-09-23 09:22:02 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-09-23 15:14:09 +0200
commit675eeb1c941706070381faaad8ee1a5d75cff4a4 (patch)
tree180f01d716fa508c45cea533973782817d980c5c /lib/smtp.c
parentf74afa40f8b6b87ccf74a4ca70b5514a9a87e6f1 (diff)
downloadcurl-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.c1
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 */