[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 40/125: curl: limit -# update frequency for unknown
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 40/125: curl: limit -# update frequency for unknown total size |
Date: |
Sun, 21 Jan 2018 23:41:35 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit b5881d1fbd544576ec876c4374c8f71240965cdc
Author: Daniel Stenberg <address@hidden>
AuthorDate: Thu Dec 7 09:29:58 2017 +0100
curl: limit -# update frequency for unknown total size
Make it use a max 10Hz update frequency for this case as well. Return
early if the "point" hasn't moved since last invoke.
Reported-by: Elliot Saba
Fixes #2158
Closes #2163
---
src/tool_cb_prg.c | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/src/tool_cb_prg.c b/src/tool_cb_prg.c
index 992b96d97..403de03a9 100644
--- a/src/tool_cb_prg.c
+++ b/src/tool_cb_prg.c
@@ -61,14 +61,27 @@ int tool_progress_cb(void *clientp,
/* we've come this far */
point = dlnow + ulnow + bar->initial_size;
- if(bar->calls && (tvdiff(now, bar->prevtime) < 100L) && point < total)
- /* after first call, limit progress-bar updating to 10 Hz */
- /* update when we're at 100% even if last update is less than 200ms ago */
- return 0;
-
- if(point > total)
- /* we have got more than the expected total! */
- total = point;
+ if(bar->calls) {
+ /* after first call... */
+ if(total) {
+ /* we know the total data to get... */
+ if(bar->prev == point)
+ /* progress didn't change since last invoke */
+ return 0;
+ else if((tvdiff(now, bar->prevtime) < 100L) && point < total)
+ /* limit progress-bar updating to 10 Hz except when we're at 100% */
+ return 0;
+ }
+ else {
+ /* total is unknown */
+ if(bar->prev/1024 == point/1024)
+ /* the same kilobyte level as last invoke */
+ return 0;
+ else if(tvdiff(now, bar->prevtime) < 100L)
+ /* limit progress-bar updating to 10 Hz */
+ return 0;
+ }
+ }
/* simply count invokes */
bar->calls++;
@@ -82,6 +95,10 @@ int tool_progress_cb(void *clientp,
}
}
else if(point != bar->prev) {
+ if(point > total)
+ /* we have got more than the expected total! */
+ total = point;
+
frac = (double)point / (double)total;
percent = frac * 100.0;
barwidth = bar->width - 7;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 14/125: travis: use pip2 instead of pip, (continued)
- [GNUnet-SVN] [gnurl] 14/125: travis: use pip2 instead of pip, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 15/125: openssl: pkcs12 is supported by boringssl, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 19/125: RESOURCES: update spec names, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 21/125: ssh-libssh.c: please checksrc, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 22/125: libssh2: remove dead code from SSH_SFTP_QUOTE, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 08/125: libssh2: send the correct CURLE error code on scp file not found, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 03/125: SSL: Avoid magic allocation of SSL backend specific data, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 32/125: URL: tolerate backslash after drive letter for FILE:, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 17/125: libssh: no need to call sftp_get_error as ssh_get_error is sufficient, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 28/125: conncache: only allow multiplexing within same multi handle, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 40/125: curl: limit -# update frequency for unknown total size,
gnunet <=
- [GNUnet-SVN] [gnurl] 31/125: tests: added netinet/in6.h includes in test servers, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 41/125: configure: add AX_CODE_COVERAGE only if using gcc, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 36/125: openldap: fix checksrc nits, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 49/125: RESOLVE: output verbose text when trying to set a duplicate name, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 44/125: openssl: improve data-pending check for https proxy, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 29/125: curl-config: add --ssl-backends, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 23/125: sasl_getmesssage: make sure we have a long enough string to pass, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 24/125: libssh: remove dead code in sftp_qoute, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 34/125: examples: move threaded-shared-conn.c to the "complicated" ones, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 33/125: RELEASE-NOTES: synced with b261c44e8, gnunet, 2018/01/21