From df2093d2930bc8f4f81218f626eb886603180072 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 1 May 2020 17:42:19 +0200 Subject: libssh2: set the expected total size in SCP upload init ... 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index c487ccabb..2acd7c6cc 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -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; -- cgit v1.2.3