aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-11-24 19:51:59 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-11-24 20:49:04 +0100
commit40c349ada92865faadd0de92fa5dc0d50ba67eb3 (patch)
treefdc054926760761ca2bf35a812916f0a451d5f17
parentbb9ec5ebb29a88d5b55eece1ea90198a514a736f (diff)
done: make sure the final progress update is made
It would previously be skipped if an existing error was returned, but would lead to a previous value being left there and later used. CURLINFO_TOTAL_TIME for example. Still it avoids that final progress update if we reached DONE as the result of a callback abort to avoid another callback to be called after an abort-by-callback. Reported-by: Lukas Ruzicka Closes #538
-rw-r--r--lib/url.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index feb4517fc..13e95f42c 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -6088,8 +6088,13 @@ CURLcode Curl_done(struct connectdata **connp,
else
result = status;
- if(!result && Curl_pgrsDone(conn))
- result = CURLE_ABORTED_BY_CALLBACK;
+ if(CURLE_ABORTED_BY_CALLBACK != result) {
+ /* avoid this if we already aborted by callback to avoid this calling
+ another callback */
+ CURLcode rc = Curl_pgrsDone(conn);
+ if(!result && rc)
+ result = CURLE_ABORTED_BY_CALLBACK;
+ }
if((conn->send_pipe->size + conn->recv_pipe->size != 0 &&
!data->set.reuse_forbid &&