summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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
* tool_getparam: remove duplicate switch caseDaniel Stenberg2019-09-201-5/+1
| | | | | Fixes warning detected by PVS-Studio Fixes #4374
* curl: fix memory leaked by parse_metalink()Kamil Dudka2019-09-133-1/+8
| | | | | | | | This commit fixes a regression introduced by curl-7_65_3-5-gb88940850. Detected by tests 2005, 2008, 2009, 2010, 2011, and 2012 with valgrind and libmetalink enabled. Closes #4326
* curl:file2string: load large files much fasterGilles Vollant2019-09-131-7/+24
| | | | | | | ... by using a more efficient realloc scheme. Bug: https://curl.haxx.se/mail/lib-2019-09/0045.html Closes #4336
* curl: make sure the parallel transfers do them allDaniel Stenberg2019-09-101-5/+24
| | | | | | | | | The logic could erroneously break the loop too early before all transfers had been transferred. Reported-by: Tom van der Woerdt Fixes #4316 Closes #4317
* tool_setopt: handle a libcurl build without netrc supportDaniel Stenberg2019-09-091-0/+10
| | | | | | Reported-by: codesniffer13 on github Fixes #4302 Closes #4305
* curl: fix include conditionslufia2019-08-292-1/+5
|
* cleanup: remove DOT_CHAR completelyDaniel Stenberg2019-08-201-1/+1
| | | | | | | | | | | | Follow-up to f9c7ba9096ec The use of DOT_CHAR for ".ssh" was probably a mistake and is removed now. Pointed-out-by: Gisle Vanem Bug: https://github.com/curl/curl/pull/4230#issuecomment-522960638 Closes #4247
* curl: make --libcurl use CURL_HTTP_VERSION_3Daniel Stenberg2019-08-201-0/+1
| | | | Closes #4243
* curl: use .curlrc (with a dot) on Windows as wellDaniel Stenberg2019-08-201-51/+66
| | | | | | | | Fall-back to _curlrc if the dot-version is missing. Co-Authored-By: Steve Holme Closes #4230
* cleanup: s/curl_debug/curl_dbg_debug in comments and docsDaniel Stenberg2019-08-081-3/+3
| | | | | | | | | | Leftovers from the function rename back in 76b63489495 Reported-by: Gisle Vanem Bug: https://github.com/curl/curl/commit/f3e0f071b14fcb46a453f69bdf4e062bcaacf362#com mitcomment-34601751 Closes #4203
* CURLOPT_HTTP_VERSION: seting this to 3 forces HTTP/3 use directlyDaniel Stenberg2019-08-084-9/+5
| | | | | | | | | | | | Even though it cannot fall-back to a lower HTTP version automatically. The safer way to upgrade remains via CURLOPT_ALTSVC. CURLOPT_H3 no longer has any bits that do anything and might be removed before we remove the experimental label. Updated the curl tool accordingly to use "--http3". Closes #4197
* curl: make use of CURLINFO_RETRY_AFTER when retryingDaniel Stenberg2019-08-071-1/+14
| | | | | | | | If a Retry-After: header was used in the response, that value overrides other retry timing options. Fixes #3794 Closes #4195
* curl: use CURLINFO_PROTOCOL to check for HTTP(s)Daniel Stenberg2019-08-071-4/+3
| | | | ... instead of CURLINFO_EFFECTIVE_URL to avoid string operations.
* curl: have -w's 'http_version' show '3' for HTTP/3Daniel Stenberg2019-08-071-1/+4
| | | | Closes #4196
* curl: --sasl-authzid added to support CURLOPT_SASL_AUTHZID from the toolSteve Holme2019-08-065-1/+14
| | | | | | | | | | | | Ref: https://github.com/curl/curl/issues/3653 Ref: https://github.com/curl/curl/pull/3790 NOTE: This commit was cherry-picked and is part of a series of commits that added the authzid feature for upcoming 7.66.0. The series was temporarily reverted in db8ec1f so that it would not ship in a 7.65.x patch release. Closes https://github.com/curl/curl/pull/4186
* curl_multi_poll: a sister to curl_multi_wait() that waits moreDaniel Stenberg2019-08-061-40/+2
| | | | | | | | | | | | | | | | | | | | | | | | Repeatedly we see problems where using curl_multi_wait() is difficult or just awkward because if it has no file descriptor to wait for internally, it returns immediately and leaves it to the caller to wait for a small amount of time in order to avoid occasional busy-looping. This is often missed or misunderstood, leading to underperforming applications. This change introduces curl_multi_poll() as a replacement drop-in function that accepts the exact same set of arguments. This function works identically to curl_multi_wait() - EXCEPT - for the case when there's nothing to wait for internally, as then this function will by itself wait for a "suitable" short time before it returns. This effectiely avoids all risks of busy-looping and should also make it less likely that apps "over-wait". This also changes the curl tool to use this funtion internally when doing parallel transfers and changes curl_easy_perform() to use it internally. Closes #4163
* http09: disable HTTP/0.9 by default in both tool and libraryDaniel Stenberg2019-08-061-1/+1
| | | | | | | | As the plan has been laid out in DEPRECATED. Update docs accordingly and verify in test 1174. Now requires the option to be set to allow HTTP/0.9 responses. Closes #4191
* src/makefile: fix uncompressed hugehelp.c generationDaniel Stenberg2019-08-011-1/+1
| | | | | | | | Regression from 5cf5d57ab9 (7.64.1) Fixed-by: Lance Ware Fixes #4176 Closes #4177
* curl: remove outdated commentDaniel Stenberg2019-07-301-6/+0
| | | | | | | | Turned bad with commit b8894085000 Reported-by: niallor on github Fixes #4172 Closes #4173
* curl: cap the maximum allowed values for retry time argumentsDaniel Stenberg2019-07-303-3/+26
| | | | | | | | | | ... to avoid integer overflows later when multiplying with 1000 to convert seconds to milliseconds. Added test 1269 to verify. Reported-by: Jason Lee Closes #4166
* curl: avoid uncessary libcurl timeouts (in parallel mode)Daniel Stenberg2019-07-291-2/+5
| | | | | | | When curl_multi_wait() returns OK without file descriptors to wait for, it might already have done a long timeout. Closes #4159
* tool_operate: fix implicit call to easysrc_cleanupJay Satiro2019-07-231-2/+6
| | | | | | | | | | easysrc_cleanup is only defined when CURL_DISABLE_LIBCURL_OPTION is not defined, and prior to this change would be called regardless. Bug: https://github.com/curl/curl/pull/3804#issuecomment-513922637 Reported-by: Marcel Raad Closes https://github.com/curl/curl/pull/4142
* curl:create_transfers check return code from curl_easy_setoptDaniel Stenberg2019-07-221-1/+3
| | | | | | | | From commit b8894085 Pointed out by Coverity CID 1451703 Closes #4134
* HTTP3: initial (experimental) supportDaniel Stenberg2019-07-214-1/+13
| | | | | | | | | USe configure --with-ngtcp2 or --with-quiche Using either option will enable a HTTP3 build. Co-authored-by: Alessandro Ghedini <alessandro@ghedini.me> Closes #3500
* curl: remove dead codeDaniel Stenberg2019-07-211-25/+19
| | | | | | | The loop never loops (since b889408500), pointed out by Coverity (CID 1451702) Closes #4133
* curl: support parallel transfersDaniel Stenberg2019-07-2018-753/+1414
| | | | | | | | This is done by making sure each individual transfer is first added to a linked list as then they can be performed serially, or at will, in parallel. Closes #3804
* 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
* curl: skip CURLOPT_PROXY_CAPATH for disabled-proxy buildsKoen Dergent2019-06-241-1/+2
| | | | Closes #4061
* curl: improved skip-setopt-options when built with disabled featuresDaniel Stenberg2019-06-183-35/+80
| | | | | | | Reduces #ifdefs in src/tool_operate.c Follow-up from 4e86f2fc4e6 Closes #3936
* 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 warningsMarcel Raad2019-06-051-1/+1
| | | | | | Reduce variable scopes and remove redundant variable stores. Closes https://github.com/curl/curl/pull/3975
* tool_parsecfg: Use correct return type for GetModuleFileName()Steve Holme2019-06-041-2/+3
| | | | | | | GetModuleFileName() returns a DWORD which is a typedef of an unsigned long and not an int. Closes #3980