From 907520c4b93616bddea15757bbf0bfb45cde8101 Mon Sep 17 00:00:00 2001 From: Ray Satiro Date: Mon, 9 Jun 2014 23:57:14 +0200 Subject: 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 --- lib/multi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/multi.c') diff --git a/lib/multi.c b/lib/multi.c index 1fb341ca6..ca975a056 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1610,7 +1610,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, Curl_multi_process_pending_handles(multi); /* post-transfer command */ - res = Curl_done(&data->easy_conn, CURLE_OK, FALSE); + res = Curl_done(&data->easy_conn, data->result, FALSE); /* allow a previously set error code take precedence */ if(!data->result) -- cgit v1.2.3