]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
libssh2: set the expected total size in SCP upload init
authorDaniel Stenberg <daniel@haxx.se>
Fri, 1 May 2020 15:42:19 +0000 (17:42 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 2 May 2020 14:38:48 +0000 (16:38 +0200)
... as otherwise the progress callback gets called without that
information, making the progress meter have less info.

Reported-by: Murugan Balraj
Bug: https://curl.haxx.se/mail/archive-2020-05/0000.html
Closes #5317

lib/vssh/libssh2.c

index c487ccabb5d9bd4f8ab8a8620aac45bebc8df9ef..2acd7c6cc0b50e7bd634a9da516ce6fbacffef3f 100644 (file)
@@ -2551,7 +2551,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
       }
 
       /* upload data */
-      Curl_setup_transfer(data, -1, data->req.size, FALSE, FIRSTSOCKET);
+      data->req.size = data->state.infilesize;
+      Curl_pgrsSetUploadSize(data, data->state.infilesize);
+      Curl_setup_transfer(data, -1, -1, FALSE, FIRSTSOCKET);
 
       /* not set by Curl_setup_transfer to preserve keepon bits */
       conn->sockfd = conn->writesockfd;