aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorRay Satiro <raysatiro@yahoo.com>2014-06-09 23:57:14 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-07-02 23:53:25 +0200
commit907520c4b93616bddea15757bbf0bfb45cde8101 (patch)
treeb6dfe0019c6e9ff69d91318898ab9fc966e7c007 /lib/url.c
parent1c1d9a3a86e9748e234de925c93b9392fa3cf062 (diff)
progress callback: skip last callback update on errors
When an error has been detected, skip the final forced call to the progress callback by making sure to pass the current return code variable in the Curl_done() call in the CURLM_STATE_DONE state. This avoids the "extra" callback that could occur even if you returned error from the progress callback. Bug: http://curl.haxx.se/mail/lib-2014-06/0062.html Reported by: Jonathan Cardoso Machado
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index 770b0cc95..5209c8dce 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -5796,9 +5796,9 @@ CURLcode Curl_done(struct connectdata **connp,
if(conn->handler->done)
result = conn->handler->done(conn, status, premature);
else
- result = CURLE_OK;
+ result = status;
- if(Curl_pgrsDone(conn) && !result)
+ if(!result && Curl_pgrsDone(conn))
result = CURLE_ABORTED_BY_CALLBACK;
/* if the transfer was completed in a paused state there can be buffered