summaryrefslogtreecommitdiff
path: root/src/tool_cb_prg.c
Commit message (Collapse)AuthorAgeFilesLines
* curl: make the -# spaceship bar not wrap the lineDaniel Stenberg2020-01-261-20/+27
| | | | | | | | | | | | | The fixed-point math made us lose precision and thus a too high index value could be used for outputting the hashtags which could overwrite the newline. The fix increases the precision in the sine table (*100) and the associated position math. Reported-by: Andrew Potter Fixes #4849 Closes #4850
* curl:progressbarinit: ignore column width from terminals < 20Daniel Stenberg2020-01-161-1/+2
| | | | | | | To avoid division by zero - or other issues. Reported-by: Daniel Marjamäki Closes #4818
* curl: remove 'config' field from OutStructDaniel Stenberg2020-01-121-3/+2
| | | | | | | | | | | | As it was just unnecessary duplicated information already stored in the 'per_transfer' struct and that's around mostly anyway. The duplicated pointer caused problems when the code flow was aborted before the dupe was filled in and could cause a NULL pointer access. Reported-by: Brian Carpenter Fixes #4807 Closes #4810
* curl: fix --upload-file . hangs if delay in STDINJohn Schroeder2019-11-261-1/+10
| | | | | | | | | | | | | | | Attempt to unpause a busy read in the CURLOPT_XFERINFOFUNCTION. When uploading from stdin in non-blocking mode, a delay in reading the stream (EAGAIN) causes curl to pause sending data (CURL_READFUNC_PAUSE). Prior to this change, a busy read was detected and unpaused only in the CURLOPT_WRITEFUNCTION handler. This change performs the same busy read handling in a CURLOPT_XFERINFOFUNCTION handler. Fixes #2051 Closes #4599 Reported-by: bdry on github
* curl: only accept COLUMNS less than 10000Daniel Stenberg2019-07-161-1/+2
| | | | | | | | ... as larger values would rather indicate something silly (and could potentially cause buffer problems). Reported-by: pendrek at hackerone Closes #4114
* tool_cb_prg: Fix integer overflow in progress barDaniel Gustafsson2019-06-101-4/+9
| | | | | | | | | | | | | Commit 61faa0b420c236480bc9ef6fd52b4ecc1e0f8d17 fixed the progress bar width calculation to avoid integer overflow, but failed to account for the fact that initial_size is initialized to -1 when the file size is retrieved from the remote on an upload, causing another signed integer overflow. Fix by separately checking for this case before the width calculation. Closes #3984 Reported-by: Brian Carpenter (Geeknik Labs) Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* build: fix Codacy/CppCheck warningsMarcel Raad2019-04-111-1/+1
| | | | | | | | | | - remove unused variables - declare conditionally used variables conditionally - suppress unused variable warnings in the CMake tests - remove dead variable stores - consistently use WIN32 macro to detect Windows Closes https://github.com/curl/curl/pull/3739
* tool_cb_prg: avoid integer overflowDaniel Stenberg2019-01-111-3/+16
| | | | | | | | When calculating the progress bar width. Reported-by: Peng Li Fixes #3456 Closes #3458
* snprintf: renamed and we now only use msnprintf()Daniel Stenberg2018-11-231-2/+2
| | | | | | | | | | | The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
* cppcheck: fix warningsMarian Klymov2018-06-111-6/+6
| | | | | | | | | | | | | - Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
* build: fix termios issue on android cross-compileBen Greear2018-02-011-0/+6
| | | | | Bug: https://curl.haxx.se/mail/lib-2018-01/0122.html Signed-off-by: Ben Greear <greearb@candelatech.com>
* progress-bar: don't use stderr explicitly, use bar->outDaniel Stenberg2018-01-241-1/+1
| | | | | Reported-By: Gisle Vanem Bug: https://github.com/curl/curl/commit/993dd5651a6c853bfe3870f6a69c7b329fa4e8ce#commitcomment-27070080
* progress-bar: get screen width on windowsGisle Vanem2018-01-231-0/+15
|
* curl: progress bar refresh, get width using ioctl()Daniel Stenberg2018-01-221-19/+89
| | | | | | | | | | | | | Get screen width from the environment variable COLUMNS first, if set. If not, use ioctl(). If nether works, assume 79. Closes #2242 The "refresh" is for the -# output when no total transfer size is known. It will now only use a single updated line even for this case: The "-=O=-" ship moves when data is transferred. The four flying "hashes" move (on a sine wave) on each refresh, independent of data.
* curl: remove __EMX__ #ifdefsDaniel Stenberg2017-12-081-20/+0
| | | | | | | | These are OS/2-specific things added to the code in the year 2000. They were always ugly. If there's any user left, they still don't need it done this way. Closes #2166
* curl: limit -# update frequency for unknown total sizeDaniel Stenberg2017-12-071-8/+25
| | | | | | | | | | 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
* code style: use spaces around plusesDaniel Stenberg2017-09-111-2/+2
|
* tool_cb_prg: fix double-promotion warningMarcel Raad2017-05-011-1/+1
| | | | | | | | | clang complains: tool_cb_prg.c:86:22: error: implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion] Fix this by using a double instead of a float constant.
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* Revert "cleanup: general removal of TODO (and similar) comments"Daniel Stenberg2015-11-241-3/+7
| | | | | | | This reverts commit 64e959ffe37c436503f9fed1ce2d6ee6ae50bd9a. Feedback-by: Dan Fandrich URL: http://curl.haxx.se/mail/lib-2015-11/0062.html
* cleanup: general removal of TODO (and similar) commentsDaniel Stenberg2015-11-131-7/+3
| | | | | | They tend to never get updated anyway so they're frequently inaccurate and we never go back to revisit them anyway. We document issues to work on properly in KNOWN_BUGS and TODO instead.
* tool: Moved --stderr to the global configSteve Holme2014-03-011-1/+1
|
* tool_cfgable: Renamed Configurable structure to OperationConfigSteve Holme2014-02-231-2/+1
| | | | | To allow for the addition of a global config structure and prevent confusion between the two.
* Subject: progress bar: increase update frequency to 10HzTobias Markus2014-01-181-2/+2
| | | | | | | | Increasing the update frequency of the progress bar to 10Hz greatly improves the visual appearance of the progress bar (at least in my impression). Signed-off-by: Tobias Markus <tobias@markus-regensburg.de>
* progress bar: always update when at 100%Tobias Markus2014-01-181-5/+6
| | | | | | | | | | | | | Currently, the progress bar is updated at 5Hz. Because it is often not updated to 100% when the download is finished and curl exits, the bar is often "stuck" at 90-something, thus irritating the user. This patch fixes this by always updating the progress bar (instead of waiting for 200ms to have elapsed) while the download is finished but curl has not yet exited. This should not greatly affect performance because that moment is rather short. Signed-off-by: Tobias Markus <tobias@markus-regensburg.de>
* tool: use XFERFUNCTION to save some castsDave Reisner2013-10-151-5/+5
|
* curl: second follow-up for commit 5af2bfb9Yang Tse2013-08-011-1/+2
| | | | Display progress-bar unconditionally on first call
* curl: follow-up for commit 5af2bfb9Yang Tse2013-07-311-2/+3
| | | | Use tvnow() and tvdiff() to avoid introducing new linkage issues
* curl: --progress-bar max update frequency now at 5HzDaniel Stenberg2013-07-311-2/+2
|
* curl: make --progress-bar update the line less frequentlyDaniel Stenberg2013-07-311-10/+12
| | | | | | | | | | | | Also, use memset() instead of a lame loop. The previous logic that tried to avoid too many updates were very ineffective for really fast transfers, as then it could easily end up doing hundreds of updates per second that would make a significant impact in transfer performance! Bug: http://curl.haxx.se/mail/archive-2013-07/0031.html Reported-by: Marc Doughty
* Revert changes relative to lib/*.[ch] recent renamingYang Tse2013-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts renaming and usage of lib/*.h header files done 28-12-2012, reverting 2 commits: f871de0... build: make use of 76 lib/*.h renamed files ffd8e12... build: rename 76 lib/*.h files This also reverts removal of redundant include guard (redundant thanks to changes in above commits) done 2-12-2013, reverting 1 commit: c087374... curl_setup.h: remove redundant include guard This also reverts renaming and usage of lib/*.c source files done 3-12-2013, reverting 3 commits: 13606bb... build: make use of 93 lib/*.c renamed files 5b6e792... build: rename 93 lib/*.c files 7d83dff... build: commit 13606bbfde follow-up 1 Start of related discussion thread: http://curl.haxx.se/mail/lib-2013-01/0012.html Asking for confirmation on pushing this revertion commit: http://curl.haxx.se/mail/lib-2013-01/0048.html Confirmation summary: http://curl.haxx.se/mail/lib-2013-01/0079.html NOTICE: The list of 2 files that have been modified by other intermixed commits, while renamed, and also by at least one of the 6 commits this one reverts follows below. These 2 files will exhibit a hole in history unless git's '--follow' option is used when viewing logs. lib/curl_imap.h lib/curl_smtp.h
* build: make use of 76 lib/*.h renamed filesYang Tse2012-12-281-1/+1
| | | | | | 76 private header files renamed to use our standard naming scheme. This change affects 322 files in libcurl's source tree.
* -# progress meter: avoid superfluous updates and duplicate linesDaniel Stenberg2012-04-171-1/+1
| | | | | | | | | | | | | | | | | By comparing if a different "progress point" is reached or not since the previous update, the progress function callback for this now avoids many superfluous screen updates. This has the nice side-effect that it fixes a problem that causes a second progress meter line. The second line output happened because when we use the -# progress meter, we force a newline output after the transfer in the main loop in curl, but when libcurl calls the progress callback from curl_easy_cleanup() it would then output the progress display again. Possibly the naive newline output is wrong but this optimization was suitable anyway... Reported by: Daniel Theron Bug: http://curl.haxx.se/bug/view.cgi?id=3517418
* curl tool: make curl.h first header included in tool_setup.hYang Tse2012-04-081-2/+0
|
* curl tool: use configuration files from lib directoryYang Tse2012-04-061-2/+2
| | | | | | | | | | | Configuration files such as curl_config.h and all config-*.h no longer exist nor are generated/copied into 'src' directory, now these only exist in 'lib' directory from where curl tool sources uses them. Additionally old src/setup.h has been refactored into src/tool_setup.h which now pulls lib/setup.h The possibility of a makefile needing an include path adjustment exists.
* progress_cb: avoid buffer overflowDaniel Stenberg2011-11-111-5/+7
| | | | | | | | | | | | The progress bar output function would blindly use the terminal width without bounds checking. When using a very wide terminal that caused a buffer overflow and segfault. We now limit the max bar with to 255 columns, and I simplified the code to avoid an extra snprintf and buffer. Bug: http://curl.haxx.se/bug/view.cgi?id=3435710 Reported by: Alexey Zakhlestin
* curl tool: reviewed code moved to tool_*.[ch] filesYang Tse2011-09-241-0/+146