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
This commit is contained in:
Daniel Stenberg 2020-05-01 17:42:19 +02:00
parent 5cb7f893df
commit df2093d293
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View 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;