summaryrefslogtreecommitdiff
path: root/lib/progress.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2012-06-10 23:39:04 +0200
committerDaniel Stenberg <daniel@haxx.se>2012-06-10 23:40:35 +0200
commit6cd084a3b5129d9ab8db3e5bc0f094943d7eef89 (patch)
tree26d32ff78ce1a9897cee17b50196e7c401959be7 /lib/progress.c
parent72c7c1d64e101675520387c0d758b63f71d4c48a (diff)
downloadcurl-6cd084a3b5129d9ab8db3e5bc0f094943d7eef89.tar.gz
Curl_pgrsDone: return int and acknowledge return code
Since Curl_pgrsDone() itself calls Curl_pgrsUpdate() which may return an abort instruction or similar we need to return that info back and subsequently properly handle return codes from Curl_pgrsDone() where used. (Spotted by a Coverity scan)
Diffstat (limited to 'lib/progress.c')
-rw-r--r--lib/progress.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/progress.c b/lib/progress.c
index 4c9a63acb..e73f01811 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -131,11 +131,14 @@ static char *max5data(curl_off_t bytes, char *max5)
*/
-void Curl_pgrsDone(struct connectdata *conn)
+int Curl_pgrsDone(struct connectdata *conn)
{
+ int rc;
struct SessionHandle *data = conn->data;
data->progress.lastshow=0;
- Curl_pgrsUpdate(conn); /* the final (forced) update */
+ rc = Curl_pgrsUpdate(conn); /* the final (forced) update */
+ if(rc)
+ return rc;
if(!(data->progress.flags & PGRS_HIDE) &&
!data->progress.callback)
@@ -144,6 +147,7 @@ void Curl_pgrsDone(struct connectdata *conn)
fprintf(data->set.err, "\n");
data->progress.speeder_c = 0; /* reset the progress meter display */
+ return 0;
}
/* reset all times except redirect, and reset the known transfer sizes */
@@ -241,6 +245,10 @@ void Curl_pgrsSetUploadSize(struct SessionHandle *data, curl_off_t size)
data->progress.flags &= ~PGRS_UL_SIZE_KNOWN;
}
+/*
+ * Curl_pgrsUpdate() returns 0 for success or the value returned by the
+ * progress callback!
+ */
int Curl_pgrsUpdate(struct connectdata *conn)
{
struct timeval now;