]> granicus.if.org Git - curl/commitdiff
smtp: Fixed unknown percentage complete in progress bar
authorSteve Holme <steve_holme@hotmail.com>
Mon, 29 Apr 2013 21:25:12 +0000 (22:25 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Mon, 29 Apr 2013 21:34:26 +0000 (22:34 +0100)
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.

RELEASE-NOTES
lib/smtp.c

index 799b29735118a3d5e96ff69b8b85cc0ac1446ee1..53b41c88af5c7a3cd7f63831cbcc8af6dad7dc36 100644 (file)
@@ -37,6 +37,7 @@ This release includes the following bugfixes:
  o sshserver: disable StrictHostKeyChecking
  o ftpserver: Fixed imap logout confirmation data
  o curl_easy_init: use less mallocs
+ o smtp: Fixed unknown percentage complete in progress bar
  o 
 
 This release includes the following known bugs:
index 72a6135ffd19dcb955444d789d4ab3ef9f54544b..9d304850c9efca060f04bc58445d231b951b0cc1 100644 (file)
@@ -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);