summaryrefslogtreecommitdiff
path: root/lib/smtp.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-04-29 22:25:12 +0100
committerSteve Holme <steve_holme@hotmail.com>2013-04-29 22:34:26 +0100
commitb52cf5d2cd9f65e1615fcfcbd35187843ea6abc5 (patch)
treeb221ce7da0038094655a64a066bbab6b0378132a /lib/smtp.c
parent073e83b543cb9e9b083062302aea437e1435989f (diff)
downloadcurl-b52cf5d2cd9f65e1615fcfcbd35187843ea6abc5.tar.gz
smtp: Fixed unknown percentage complete in progress bar
The curl command line utility would display the the completed progress bar with a percentage of zero as the progress routines didn't know the size of the transfer.
Diffstat (limited to 'lib/smtp.c')
-rw-r--r--lib/smtp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index 72a6135ff..9d304850c 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -589,7 +589,7 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
}
}
- /* calculate the optional SIZE parameter */
+ /* Calculate the optional SIZE parameter */
if(conn->proto.smtpc.size_supported && conn->data->set.infilesize > 0) {
size = aprintf("%" FORMAT_OFF_T, data->set.infilesize);
@@ -1172,6 +1172,8 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode,
static CURLcode smtp_state_data_resp(struct connectdata *conn, int smtpcode,
smtpstate instate)
{
+ struct SessionHandle *data = conn->data;
+
(void)instate; /* no use for this yet */
if(smtpcode != 354) {
@@ -1179,6 +1181,9 @@ static CURLcode smtp_state_data_resp(struct connectdata *conn, int smtpcode,
return CURLE_SEND_ERROR;
}
+ /* Set the progress upload size */
+ Curl_pgrsSetUploadSize(data, data->set.infilesize);
+
/* SMTP upload */
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, FIRSTSOCKET, NULL);