summaryrefslogtreecommitdiff
path: root/lib/ftp.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/ftp.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/ftp.c')
-rw-r--r--lib/ftp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index a672875d3..a5083be04 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3112,6 +3112,7 @@ static CURLcode ftp_connect(struct connectdata *conn,
return result;
}
+ Curl_pp_setup(pp); /* once per transfer */
Curl_pp_init(pp); /* init the generic pingpong data */
/* When we connect, we start in the state where we await the 220