XFERINFOFUNCTION: support CURL_PROGRESSFUNC_CONTINUE

(also for PROGRESSFUNCTION)

By returning this value from the callback, the internal progress
function call is still called afterward.

Closes #4599
This commit is contained in:
John Schroeder 2019-11-26 09:13:11 +01:00 committed by Daniel Stenberg
parent 9b879160df
commit 7cf18b05e0
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 27 additions and 11 deletions

View file

@ -594,11 +594,13 @@ int Curl_pgrsUpdate(struct connectdata *conn)
data->progress.size_ul,
data->progress.uploaded);
Curl_set_in_callback(data, false);
if(result)
failf(data, "Callback aborted");
return result;
if(result != CURL_PROGRESSFUNC_CONTINUE) {
if(result)
failf(data, "Callback aborted");
return result;
}
}
if(data->set.fprogress) {
else if(data->set.fprogress) {
int result;
/* The older deprecated callback is set, call that */
Curl_set_in_callback(data, true);
@ -608,9 +610,11 @@ int Curl_pgrsUpdate(struct connectdata *conn)
(double)data->progress.size_ul,
(double)data->progress.uploaded);
Curl_set_in_callback(data, false);
if(result)
failf(data, "Callback aborted");
return result;
if(result != CURL_PROGRESSFUNC_CONTINUE) {
if(result)
failf(data, "Callback aborted");
return result;
}
}
if(showprogress)