diff options
author | Björn Stenberg <bjorn@haxx.se> | 2018-02-10 15:13:15 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-02-15 09:36:03 +0100 |
commit | b46cfbc068ebe90f18e9777b9e877e4934c1b5e3 (patch) | |
tree | 4d88b0f4d9492f51a93251e488400ff7a8abba62 /lib/progress.c | |
parent | 43a50a2580db2bfb28483a96964ae27b584472da (diff) | |
download | curl-b46cfbc068ebe90f18e9777b9e877e4934c1b5e3.tar.gz |
TODO fixed: Detect when called from within callbacks
Closes #2302
Diffstat (limited to 'lib/progress.c')
-rw-r--r-- | lib/progress.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/progress.c b/lib/progress.c index cc5e8be79..eef2ca7d4 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -24,6 +24,7 @@ #include "urldata.h" #include "sendf.h" +#include "multiif.h" #include "progress.h" #include "curl_printf.h" @@ -461,22 +462,26 @@ int Curl_pgrsUpdate(struct connectdata *conn) if(data->set.fxferinfo) { /* There's a callback set, call that */ + Curl_set_in_callback(data, true); result = data->set.fxferinfo(data->set.progress_client, data->progress.size_dl, data->progress.downloaded, data->progress.size_ul, data->progress.uploaded); + Curl_set_in_callback(data, false); if(result) failf(data, "Callback aborted"); return result; } if(data->set.fprogress) { /* The older deprecated callback is set, call that */ + Curl_set_in_callback(data, true); result = data->set.fprogress(data->set.progress_client, (double)data->progress.size_dl, (double)data->progress.downloaded, (double)data->progress.size_ul, (double)data->progress.uploaded); + Curl_set_in_callback(data, false); if(result) failf(data, "Callback aborted"); return result; |