[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 53/151: XFERINFOFUNCTION: support CURL_PROGRESSFUNC_CONTINUE
From: |
gnunet |
Subject: |
[gnurl] 53/151: XFERINFOFUNCTION: support CURL_PROGRESSFUNC_CONTINUE |
Date: |
Fri, 20 Dec 2019 14:26:02 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 7cf18b05e04bbb0f08c74d2567b0648f6c31a952
Author: John Schroeder <address@hidden>
AuthorDate: Tue Nov 26 09:13:11 2019 +0100
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
---
docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.3 | 7 +++++--
docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.3 | 7 +++++--
docs/libcurl/symbols-in-versions | 1 +
include/curl/curl.h | 5 +++++
lib/progress.c | 18 +++++++++++-------
5 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.3
b/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.3
index b077e3b6e..4cdb7ec4b 100644
--- a/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.3
+++ b/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.3
@@ -60,8 +60,11 @@ Unknown/unused argument values passed to the callback will
be set to zero
the callback will be called one or more times first, before it knows the data
sizes so a program must be made to handle that.
-Returning a non-zero value from this callback will cause libcurl to abort the
-transfer and return \fICURLE_ABORTED_BY_CALLBACK\fP.
+If your callback function returns CURL_PROGRESSFUNC_CONTINUE it will cause
+libcurl to continue executing the default progress function.
+
+Returning any other non-zero value from this callback will cause libcurl to
+abort the transfer and return \fICURLE_ABORTED_BY_CALLBACK\fP.
If you transfer data with the multi interface, this function will not be
called during periods of idleness unless you call the appropriate libcurl
diff --git a/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.3
b/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.3
index 9bd89db70..9039aa398 100644
--- a/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.3
+++ b/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.3
@@ -57,8 +57,11 @@ Unknown/unused argument values passed to the callback will
be set to zero
the callback will be called one or more times first, before it knows the data
sizes so a program must be made to handle that.
-Returning a non-zero value from this callback will cause libcurl to abort the
-transfer and return \fICURLE_ABORTED_BY_CALLBACK\fP.
+If your callback function returns CURL_PROGRESSFUNC_CONTINUE it will cause
+libcurl to continue executing the default progress function.
+
+Returning any other non-zero value from this callback will cause libcurl to
+abort the transfer and return \fICURLE_ABORTED_BY_CALLBACK\fP.
If you transfer data with the multi interface, this function will not be
called during periods of idleness unless you call the appropriate libcurl
diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions
index fb37a2dd1..29013b148 100644
--- a/docs/libcurl/symbols-in-versions
+++ b/docs/libcurl/symbols-in-versions
@@ -869,6 +869,7 @@ CURL_POLL_INOUT 7.14.0
CURL_POLL_NONE 7.14.0
CURL_POLL_OUT 7.14.0
CURL_POLL_REMOVE 7.14.0
+CURL_PROGRESSFUNC_CONTINUE 7.68.0
CURL_PROGRESS_BAR 7.1.1 - 7.4.1
CURL_PROGRESS_STATS 7.1.1 - 7.4.1
CURL_PUSH_DENY 7.44.0
diff --git a/include/curl/curl.h b/include/curl/curl.h
index d35174cec..a6d555819 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -210,6 +210,11 @@ struct curl_httppost {
set. Added in 7.46.0 */
};
+
+/* This is a return code for the progress callback that, when returned, will
+ signal libcurl to continue executing the default progress function */
+#define CURL_PROGRESSFUNC_CONTINUE 0x10000001
+
/* This is the CURLOPT_PROGRESSFUNCTION callback prototype. It is now
considered deprecated but was the only choice up until 7.31.0 */
typedef int (*curl_progress_callback)(void *clientp,
diff --git a/lib/progress.c b/lib/progress.c
index 2aa929599..60a941ab2 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -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)
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 46/151: RELEASE-NOTES: synced, (continued)
- [gnurl] 46/151: RELEASE-NOTES: synced, gnunet, 2019/12/20
- [gnurl] 49/151: schannel: fix --tls-max for when min is --tlsv1 or default, gnunet, 2019/12/20
- [gnurl] 65/151: http_ntlm: Remove duplicate NSS initialisation, gnunet, 2019/12/20
- [gnurl] 54/151: curl: fix --upload-file . hangs if delay in STDIN, gnunet, 2019/12/20
- [gnurl] 47/151: projects: Fix Visual Studio projects SSH builds, gnunet, 2019/12/20
- [gnurl] 56/151: travis: export the CC/CXX variables when set, gnunet, 2019/12/20
- [gnurl] 57/151: ngtcp2: fix thread-safety bug in error-handling, gnunet, 2019/12/20
- [gnurl] 60/151: mailmap: Niall O'Reilly's name, gnunet, 2019/12/20
- [gnurl] 61/151: docs: fix typos, gnunet, 2019/12/20
- [gnurl] 38/151: projects: Fix Visual Studio wolfSSL configurations, gnunet, 2019/12/20
- [gnurl] 53/151: XFERINFOFUNCTION: support CURL_PROGRESSFUNC_CONTINUE,
gnunet <=
- [gnurl] 66/151: curl_setup_once: consistently use WHILE_FALSE in macros, gnunet, 2019/12/20
- [gnurl] 48/151: checksrc.bat: Add a check for vquic and vssh directories, gnunet, 2019/12/20
- [gnurl] 64/151: checksrc: fix regexp for ASSIGNWITHINCONDITION, gnunet, 2019/12/20
- [gnurl] 58/151: travis: build ngtcp2 with --enable-lib-only, gnunet, 2019/12/20
- [gnurl] 51/151: curl_multi_wakeup.3: add example and AVAILABILITY, gnunet, 2019/12/20
- [gnurl] 55/151: dist: add error-codes.pl, gnunet, 2019/12/20
- [gnurl] 63/151: RELEASE-NOTES: synced, gnunet, 2019/12/20
- [gnurl] 59/151: doh: use dedicated probe slots, gnunet, 2019/12/20
- [gnurl] 62/151: curl: two new command line options for etags, gnunet, 2019/12/20
- [gnurl] 70/151: global_init: undo the "intialized" bump in case of failure, gnunet, 2019/12/20