summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: comment typosDaniel Stenberg2020-02-211-2/+2
| | | | | | Spotted by 'codespell' Closes #4957
* win32: USE_WIN32_CRYPTO to enable Win32 based MD4, MD5 and SHA256 functionsSteve Holme2020-02-201-2/+2
| | | | | | | | | Whilst lib\md4.c used this pre-processor, lib\md5.c and src\tool_metalink.c did not and simply relied on the WIN32 pre-processor directive. Reviewed-by: Marcel Raad Closes #4955
* nit: Copyright year out of dateDaniel Stenberg2020-02-194-4/+4
| | | | Follow-up to 1fc0617dcc
* tool_util: Improve Windows version of tvnow()Jay Satiro2020-02-184-32/+70
| | | | | | | | | | | | | | | | | | | | | | | | | - Change tool_util.c tvnow() for Windows to match more closely to timeval.c Curl_now(). - Create a win32 init function for the tool, since some initialization is required for the tvnow() changes. Prior to this change the monotonic time function used by curl in Windows was determined at build-time and not runtime. That was a problem because when curl was built targeted for compatibility with old versions of Windows (eg _WIN32_WINNT < 0x0600) it would use GetTickCount which wraps every 49.7 days that Windows has been running. This change makes curl behave similar to libcurl's tvnow function, which determines at runtime whether the OS is Vista+ and if so calls QueryPerformanceCounter instead. (Note QueryPerformanceCounter is used because it has higher resolution than the more obvious candidate GetTickCount64). The changes to tvnow are basically a copy and paste but the types in some cases are different. Ref: https://github.com/curl/curl/issues/3309 Closes https://github.com/curl/curl/pull/4847
* tool_home: Fix the copyright year being out of dateSteve Holme2020-02-131-1/+1
| | | | Follow up to 9dc350b6.
* tool_homedir: Change GetEnv() to use libcurl's curl_getenv()Jay Satiro2020-02-121-31/+24
| | | | | | | | | | | | | | | | | | | | | | - Deduplicate GetEnv() code. - On Windows change ultimate call to use Windows API GetEnvironmentVariable() instead of C runtime getenv(). Prior to this change both libcurl and the tool had their own GetEnv which over time diverged. Now the tool's GetEnv is a wrapper around curl_getenv (libcurl API function which is itself a wrapper around libcurl's GetEnv). Furthermore this change fixes a bug in that Windows API GetEnvironmentVariable() is called instead of C runtime getenv() to get the environment variable since some changes aren't always visible to the latter. Reported-by: Christoph M. Becker Fixes https://github.com/curl/curl/issues/4774 Closes https://github.com/curl/curl/pull/4863
* curl: error on --alt-svc use w/o supportDaniel Stenberg2020-02-052-4/+4
| | | | | | | | Make the tool check for alt-svc support at run-time and return error accordingly if not present when the option is used. Reported-by: Harry Sintonen Closes #4878
* tool_operhlp: Copyright year out of date, should be 2020Daniel Stenberg2020-02-041-1/+1
| | | | Follow-up from 2bc373740a3
* curl: avoid using strlen for testing if a string is emptyOrgad Shaneh2020-02-042-2/+2
| | | | Closes #4873
* 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
* smtp: Allow RCPT TO command to fail for some recipientsPavel Volgarev2020-01-214-2/+13
| | | | | | | | Introduces CURLOPT_MAIL_RCPT_ALLLOWFAILS. Verified with the new tests 3002-3007 Closes #4816
* curl: Let -D merge headers in one file againEmil Engler2020-01-211-1/+2
| | | | | Closes #4762 Fixes #4753
* 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
* CMake: Add support for CMAKE_LTO option.Tobias Hieta2020-01-131-0/+6
| | | | | | | This enables Link Time Optimization. LTO is a proven technique for optimizing across compilation units. Closes #4799
* curl: make #0 not output the full URLDaniel Stenberg2020-01-131-2/+2
| | | | | | | | | | It was not intended nor documented! Added test 1176 to verify. Reported-by: vshmuk on hackerone Closes #4812
* curl: remove 'config' field from OutStructDaniel Stenberg2020-01-129-52/+48
| | | | | | | | | | | | 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
* tool_dirhie.c: fix the copyright year rangeDaniel Stenberg2020-01-091-1/+1
| | | | Follow-up to: 4027bd72d9
* tool_dirhie: Allow directory traversal during creationJay Satiro2020-01-091-2/+17
| | | | | | | | | | | | | | | | | | | - When creating a directory hierarchy do not error when mkdir fails due to error EACCESS (13) "access denied". Some file systems allow for directory traversal; in this case that it should be possible to create child directories when permission to the parent directory is restricted. This is a regression caused by me in f16bed0 (precedes curl-7_61_1). Basically I had assumed that if a directory already existed it would fail only with error EEXIST, and not error EACCES. The latter may happen if the directory exists but has certain restricted permissions. Reported-by: mbeifuss@users.noreply.github.com Fixes https://github.com/curl/curl/issues/4796 Closes https://github.com/curl/curl/pull/4797
* curl -w: handle a blank input file correctlyDaniel Stenberg2020-01-061-2/+2
| | | | | | | | | | Previously it would end up with an uninitialized memory buffer that would lead to a crash or junk getting output. Added test 1271 to verify. Reported-by: Brian Carpenter Closes #4786
* curl:getparameter return error for --http3 if libcurl doesn't supportDaniel Stenberg2020-01-051-2/+5
| | | | Closes #4785
* curl: properly free mimepost dataDaniel Stenberg2020-01-041-0/+3
| | | | | | | | | | ... as it could otherwise leak memory when a transfer failed. Added test 1293 to verify. Reported-by: Brian Carpenter Fixes #4781 Closes #4782
* curl: cleanup multi handle on failureDaniel Stenberg2020-01-041-2/+4
| | | | | | | | ... to fix memory leak in error path. Fixes #4772 Closes #4780 Reported-by: Brian Carpenter
* tool: make a few char pointers point to const char insteadMarcel Raad2019-12-313-4/+3
| | | | | | These are read-only. Closes https://github.com/curl/curl/pull/4771
* tool_operate: fix mem leak when failed config parseJay Satiro2019-12-291-1/+3
| | | | | | | | Found by fuzzing the config file. Reported-by: Geeknik Labs Fixes https://github.com/curl/curl/issues/4767
* curl/parseconfig: use curl_free() to free memory allocated by libcurlDaniel Stenberg2019-12-181-2/+2
| | | | | | Reported-by: bxac on github Fixes #4730 Closes #4731
* curl/parseconfig: fix mem-leakDaniel Stenberg2019-12-181-0/+2
| | | | | | | When looping, first trying '.curlrc' and then '_curlrc', the function would not free the first string. Closes #4731
* curl: fix memory leak in OOM in etags logicDaniel Stenberg2019-12-121-10/+9
| | | | | | Detected by torture tests Closes #4706
* curl: improved cleanup in upload error pathDaniel Stenberg2019-12-121-5/+6
| | | | | | Memory leak found by torture test 58 Closes #4705
* curl: use errorf() betterDaniel Stenberg2019-12-104-16/+17
| | | | | | | | | | Change series of error outputs to use errorf(). Only errors that are due to mistakes in command line option usage should use helpf(), other types of errors in the tool should rather use errorf(). Closes #4691
* curl: make the etag load logic work without fseekDaniel Stenberg2019-12-061-16/+3
| | | | | | The fseek()s were unnecessary and caused Coverity warning CID 1456554 Closes #4681
* lib: fix some loose ends for recently added CURLSSLOPT_NO_PARTIALCHAINJay Satiro2019-12-051-0/+1
| | | | | | | | | | | | | Add support for CURLSSLOPT_NO_PARTIALCHAIN in CURLOPT_PROXY_SSL_OPTIONS and OS400 package spec. Also I added the option to the NameValue list in the tool even though it isn't exposed as a command-line option (...yet?). (NameValue stringizes the option name for the curl cmd -> libcurl source generator) Follow-up to 564d88a which added CURLSSLOPT_NO_PARTIALCHAIN. Ref: https://github.com/curl/curl/pull/4655
* etag: allow both --etag-compare and --etag-save in same cmdlineDaniel Stenberg2019-12-051-10/+0
| | | | | Fixes #4669 Closes #4678
* curl: show better error message when no homedir is foundDaniel Stenberg2019-12-033-2/+19
| | | | | | Reported-by: Vlastimil Ovčáčík Fixes #4644 Closes #4665
* copyright: fix the year ranges for two filesDaniel Stenberg2019-12-021-1/+1
| | | | Follow-up to 9c1806ae
* build: Disable Visual Studio warning "conditional expression is constant"Jay Satiro2019-12-016-36/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Disable warning C4127 "conditional expression is constant" globally in curl_setup.h for when building with Microsoft's compiler. This mainly affects building with the Visual Studio project files found in the projects dir. Prior to this change the cmake and winbuild build systems already disabled 4127 globally for when building with Microsoft's compiler. Also, 4127 was already disabled for all build systems in the limited circumstance of the WHILE_FALSE macro which disabled the warning specifically for while(0). This commit removes the WHILE_FALSE macro and all other cruft in favor of disabling globally in curl_setup. Background: We have various macros that cause 0 or 1 to be evaluated, which would cause warning C4127 in Visual Studio. For example this causes it: #define Curl_resolver_asynch() 1 Full behavior is not clearly defined and inconsistent across versions. However it is documented that since VS 2015 Update 3 Microsoft has addressed this somewhat but not entirely, not warning on while(true) for example. Prior to this change some C4127 warnings occurred when I built with Visual Studio using the generated projects in the projects dir. Closes https://github.com/curl/curl/pull/4658
* curl: two new command line options for etagsMaros Priputen2019-11-288-1/+176
| | | | | | | | --etag-compare and --etag-save Suggested-by: Paul Hoffman Fixes #4277 Closes #4543
* curl: fix --upload-file . hangs if delay in STDINJohn Schroeder2019-11-266-4/+63
| | | | | | | | | | | | | | | 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: add --parallel-immediateDaniel Stenberg2019-11-214-0/+11
| | | | | | | | | | | | | | | Starting with this change when doing parallel transfers, without this option set, curl will prefer to create new transfers multiplexed on an existing connection rather than creating a brand new one. --parallel-immediate can be set to tell curl to prefer to use new connections rather than to wait and try to multiplex. libcurl-wise, this means that curl will set CURLOPT_PIPEWAIT by default on parallel transfers. Suggested-by: Tom van der Woerdt Closes #4500
* curl: fix -T globbingDaniel Stenberg2019-11-141-6/+9
| | | | | | | | | | | | Regression from e59371a4936f8 (7.67.0) Added test 490, 491 and 492 to verify the functionality. Reported-by: Kamil Dudka Reported-by: Anderson Sasaki Fixes #4588 Closes #4591
* copyrights: fix copyright year rangeDaniel Stenberg2019-11-0838-38/+38
| | | | | | | | .. because checksrc's copyright year check stopped working. Ref: https://github.com/curl/curl/pull/4547 Closes https://github.com/curl/curl/pull/4549
* tool_operate: Fix retry sleep time shown to user when Retry-AfterStian Soiland-Reyes2019-10-161-1/+1
| | | | | | | | | | - If server header Retry-After is being used for retry sleep time then show that value to the user instead of the normal retry sleep time. This is a follow-up to 640b973 (7.66.0) which changed curl tool so that the value from Retry-After header overrides other retry timing options. Closes https://github.com/curl/curl/pull/4498
* docs: document it as --no-progress-meter instead of the reverseDaniel Stenberg2019-10-091-2/+2
| | | | | | | | Follow-up to 93373a960c3bb4 Reported-by: infinnovation-dev on github Fixes #4474 Closes #4475
* curl: --no-progress-meterDaniel Stenberg2019-10-082-5/+13
| | | | | | | | | New option that allows a user to ONLY switch off curl's progress meter and leave everything else in "talkative" mode. Reported-by: Piotr Komborski Fixes #4422 Closes #4470
* curl: ensure HTTP 429 triggers --retryStian Soiland-Reyes2019-10-051-0/+1
| | | | | | | | This completes #3794. Also make sure the new tests from #4195 are enabled Closes #4465
* ESNI: initial build/setupNiall2019-10-021-0/+1
| | | | Closes #4011
* tool_operate: rename functions to make more senseDaniel Stenberg2019-10-021-32/+35
|
* curl: create easy handles on-demand and not ahead of timeDaniel Stenberg2019-10-026-218/+307
| | | | | | | | | | This should again enable crazy-large download ranges of the style [1-10000000] that otherwise easily ran out of memory starting in 7.66.0 when this new handle allocating scheme was introduced. Reported-by: Peter Sumatra Fixes #4393 Closes #4438
* curl: exit the create_transfers loop on errorsDaniel Stenberg2019-09-221-8/+5
| | | | | | | | | | When looping around the ranges and given URLs to create transfers, all errors should exit the loop and return. Previously it would keep looping. Reported-by: SumatraPeter on github Bug: #4393 Closes #4396
* tool_operate: removed unused variable 'done'Daniel Stenberg2019-09-201-2/+1
| | | | | Fixes warning detected by PVS-Studio Fixes #4374
* tool_operate: Expression 'config->resume_from' is always trueDaniel Stenberg2019-09-201-2/+2
| | | | | Fixes warning detected by PVS-Studio Fixes #4374