diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftp.c | 4 | ||||
-rw-r--r-- | lib/http.c | 2 | ||||
-rw-r--r-- | lib/imap.c | 6 | ||||
-rw-r--r-- | lib/pop3.c | 4 | ||||
-rw-r--r-- | lib/progress.c | 22 | ||||
-rw-r--r-- | lib/smtp.c | 4 | ||||
-rw-r--r-- | lib/ssh.c | 4 |
7 files changed, 26 insertions, 20 deletions
@@ -4470,8 +4470,8 @@ CURLcode ftp_regular_transfer(struct connectdata *conn, Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, 0); - Curl_pgrsSetDownloadSize(data, 0); + Curl_pgrsSetUploadSize(data, -1); + Curl_pgrsSetDownloadSize(data, -1); ftpc->ctl_valid = TRUE; /* starts good */ diff --git a/lib/http.c b/lib/http.c index 3fdab27ee..35baa3407 100644 --- a/lib/http.c +++ b/lib/http.c @@ -2351,7 +2351,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) return result; http->postdata = NULL; /* nothing to post at this point */ - Curl_pgrsSetUploadSize(data, 0); /* upload size is 0 atm */ + Curl_pgrsSetUploadSize(data, -1); /* upload size is unknown atm */ /* If 'authdone' is FALSE, we must not set the write socket index to the Curl_transfer() call below, as we're not ready to actually upload any diff --git a/lib/imap.c b/lib/imap.c index e80bc03c1..9fc472866 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1662,7 +1662,7 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode, (void)instate; /* no use for this yet */ if(imapcode != '*') { - Curl_pgrsSetDownloadSize(data, 0); + Curl_pgrsSetDownloadSize(data, -1); state(conn, IMAP_STOP); return CURLE_REMOTE_FILE_NOT_FOUND; /* TODO: Fix error code */ } @@ -2336,8 +2336,8 @@ static CURLcode imap_regular_transfer(struct connectdata *conn, /* Set the progress data */ Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, 0); - Curl_pgrsSetDownloadSize(data, 0); + Curl_pgrsSetUploadSize(data, -1); + Curl_pgrsSetDownloadSize(data, -1); /* Carry out the perform */ result = imap_perform(conn, &connected, dophase_done); diff --git a/lib/pop3.c b/lib/pop3.c index e69f5c5cf..dc64f8106 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -1935,8 +1935,8 @@ static CURLcode pop3_regular_transfer(struct connectdata *conn, /* Set the progress data */ Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, 0); - Curl_pgrsSetDownloadSize(data, 0); + Curl_pgrsSetUploadSize(data, -1); + Curl_pgrsSetDownloadSize(data, -1); /* Carry out the perform */ result = pop3_perform(conn, &connected, dophase_done); diff --git a/lib/progress.c b/lib/progress.c index e6a8d825a..f147ce71e 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -159,8 +159,8 @@ void Curl_pgrsResetTimesSizes(struct SessionHandle *data) data->progress.t_pretransfer = 0.0; data->progress.t_starttransfer = 0.0; - Curl_pgrsSetDownloadSize(data, 0); - Curl_pgrsSetUploadSize(data, 0); + Curl_pgrsSetDownloadSize(data, -1); + Curl_pgrsSetUploadSize(data, -1); } void Curl_pgrsTime(struct SessionHandle *data, timerid timer) @@ -234,20 +234,26 @@ void Curl_pgrsSetUploadCounter(struct SessionHandle *data, curl_off_t size) void Curl_pgrsSetDownloadSize(struct SessionHandle *data, curl_off_t size) { - data->progress.size_dl = size; - if(size >= 0) + if(size >= 0) { + data->progress.size_dl = size; data->progress.flags |= PGRS_DL_SIZE_KNOWN; - else + } + else { + data->progress.size_dl = 0; data->progress.flags &= ~PGRS_DL_SIZE_KNOWN; + } } void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size) { - data->progress.size_ul = size; - if(size >= 0) + if(size >= 0) { + data->progress.size_ul = size; data->progress.flags |= PGRS_UL_SIZE_KNOWN; - else + } + else { + data->progress.size_ul = 0; data->progress.flags &= ~PGRS_UL_SIZE_KNOWN; + } } /* diff --git a/lib/smtp.c b/lib/smtp.c index 4dc78497c..9aa8b15bd 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -2031,8 +2031,8 @@ static CURLcode smtp_regular_transfer(struct connectdata *conn, /* Set the progress data */ Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, 0); - Curl_pgrsSetDownloadSize(data, 0); + Curl_pgrsSetUploadSize(data, -1); + Curl_pgrsSetDownloadSize(data, -1); /* Carry out the perform */ result = smtp_perform(conn, &connected, dophase_done); @@ -2878,8 +2878,8 @@ static CURLcode ssh_do(struct connectdata *conn, bool *done) Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0); - Curl_pgrsSetUploadSize(data, 0); - Curl_pgrsSetDownloadSize(data, 0); + Curl_pgrsSetUploadSize(data, -1); + Curl_pgrsSetDownloadSize(data, -1); if(conn->handler->protocol & CURLPROTO_SCP) res = scp_perform(conn, &connected, done); |