summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* curl: set CURLOPT_NEW_FILE_PERMS if requestedbagder/set-new-file-permsDaniel Stenberg2021-02-261-0/+3
| | | | | | | | | The --create-file-mode code logic accepted the value but never actually passed it on to libcurl! Follow-up to a7696c73436f (shipped in 7.75.0) Reported-by: Johannes Lesr Fixes #6657
* gnutls: Fix nettle discoveryDaniel Gustafsson2021-02-253-70/+2
| | | | | | | | | | | | | | | | | Commit e06fa7462ac258c removed support for libgcrypt leaving only support for nettle which has been the default crypto library in GnuTLS for a long time. There were however a few conditionals on USE_GNUTLS_NETTLE which cause compilation errors in the metalink code (as it used the gcrypt fallback instead as a result). See the below autobuild for an example of the error: https://curl.se/dev/log.cgi?id=20210225123226-30704#prob1 This removes all uses of USE_GNUTLS_NETTLE and also removes the gcrypt support from the metalink code while at it. Closes #6656 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* cookies: Support multiple -b parametersDaniel Gustafsson2021-02-257-15/+48
| | | | | | | | | | Previously only a single -b cookie parameter was supported with the last one winning. This adds support for supplying multiple -b params to have them serialized semicolon separated. Both cookiefiles and cookies can be entered multiple times. Closes #6649 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* build: remove all traces of USE_BLOCKING_SOCKETSDaniel Stenberg2021-02-256-20/+4
| | | | | | libcurl doesn't behave properly with the define set Closes #6655
* RELEASE-NOTES: syncedDaniel Stenberg2021-02-251-9/+25
|
* docs: Fix typosDaniel Gustafsson2021-02-252-3/+3
| | | | Random typos spotted when skimming docs.
* cookies: Use named parameters in header prototypesDaniel Gustafsson2021-02-231-6/+7
| | | | | | | | Align header with project style of using named parameters in the function prototypes to aid readability and self-documentation. Closes #6653 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* urldata: make 'actions[]' use unsigned char instead of intDaniel Stenberg2021-02-242-10/+10
| | | | | | | ... as it only needs a few bits per index anyway. Reviewed-by: Daniel Gustafsson Closes #6648
* configure: fail if --with-quiche is used and quiche isn't foundDaniel Stenberg2021-02-241-4/+2
| | | | Closes #6652
* cmake: use CMAKE_INSTALL_INCLUDEDIR indirectionGregor Jasny2021-02-241-1/+1
| | | | | Reviewed-by: Sergei Nikulov Closes #6440
* mingw: enable using strcasecmp()Viktor Szakats2021-02-231-1/+3
| | | | | | | | This makes the 'Features:' list sorted case-insensitively, bringing output in-line with *nix builds. Reviewed-by: Jay Satiro Closes #6644
* build: delete unused feature guardsViktor Szakats2021-02-2311-133/+7
| | | | | | | | | | - `HAVE_STRNCASECMP` - `HAVE_TCGETATTR` - `HAVE_TCSETATTR` Reviewed-by: Jay Satiro Reviewed-by: Daniel Stenberg Closes #6645
* docs: add CURLOPT_CURLU to 'See also' in curl_url_ functionsJay Satiro2021-02-236-5/+6
| | | | Closes https://github.com/curl/curl/pull/6639
* configure: make hyper opt-in, and fail if missingJacob Hoffman-Andrews2021-02-231-17/+11
| | | | | | | | | | | | Previously, configure would look for hyper by default, and use it if found; otherwise it would not use hyper, and not error. Now, configure will not look for hyper unless --with-hyper is passed. If configure looks for hyper and fails, it will error. Also, add -ld -lpthread -lm to Hyper's libs. I think they are required. Closes #6598
* multi: do once-per-transfer inits in before_perform in DID stateDaniel Stenberg2021-02-221-4/+4
| | | | | | | | | | | | | ... since the state machine might go to RATELIMITING and then back to PERFORMING doing once-per-transfer inits in that function is wrong and it caused problems with receiving chunked HTTP and it set the PRETRANSFER time much too often... Regression from b68dc34af341805aeb7b3715 (shipped in 7.75.0) Reported-by: Amaury Denoyelle Fixes #6640 Closes #6641
* RELEASE-NOTES: syncedDaniel Stenberg2021-02-211-7/+46
|
* CODE_STYLE.md: fix broken link to INTERNALSDaniel Stenberg2021-02-211-2/+2
| | | | | | | ... the link would only work if browsed on GitHub, while this link now takes the user to the website instead and thus should work on either. Reported-by: David Demelier
* curl_url_set.3: mention CURLU_PATH_AS_ISDaniel Stenberg2021-02-211-2/+6
| | | | | | | | ... it has been supported since the URL API was added. Bug: https://curl.se/mail/lib-2021-02/0046.html Closes #6638
* time: enable 64-bit time_t in supported mingw environmentsViktor Szakats2021-02-211-4/+9
| | | | | | | | | | | (Unless 32-bit `time_t` is selected manually via the `_USE_32BIT_TIME_T` mingw macro.) Previously, 64-bit `time_t` was enabled on VS2005 and newer only, and 32-bit `time_t` was used on all other Windows builds. Assisted-by: Jay Satiro Closes #6636
* test1188: Check for --fail HTTP statusJay Satiro2021-02-201-6/+15
| | | | | | | | | | | | | | | - Change the test to check for curl error on HTTP 404 Not Found. test1188 tests "--write-out with %{onerror} and %{urlnum} to stderr". Prior to this change it did that by specifying a non-existent host which would cause an error. ISPs may hijack DNS and resolve non-existent hosts so the test would not work if that was the case. Ref: https://en.wikipedia.org/wiki/DNS_hijacking#Manipulation_by_ISPs Ref: https://github.com/curl/curl/issues/6621 Ref: https://github.com/curl/curl/pull/6623 Closes https://github.com/curl/curl/pull/6637
* memdebug: close debug logfile explicitly on exitJay Satiro2021-02-201-0/+17
| | | | | | | | | | | | | | | | | | | | | | | - Use atexit to register a dbg cleanup function that closes the logfile. LeakSantizier (LSAN) calls _exit() instead of exit() when a leak is detected on exit so the logfile must be closed explicitly or data could be lost. Though _exit() does not call atexit handlers such as this, LSAN's call to _exit() comes after the atexit handlers are called. Prior to this change the logfile was not explicitly closed so it was possible that if LSAN detected a leak and called _exit (which does not flush or close files like exit) then the logfile could be missing data. That could then cause curl's memanalyze to report false leaks (eg a malloc was recorded to the logfile but the corresponding free was discarded from the buffer instead of written to the logfile, then memanalyze reports that as a leak). Ref: https://github.com/google/sanitizers/issues/1374 Bug: https://github.com/curl/curl/pull/6591#issuecomment-780396541 Closes https://github.com/curl/curl/pull/6620
* curl_multibyte: always return a heap-allocated copy of stringJay Satiro2021-02-202-22/+25
| | | | | | | | | | | | | | | | | | | - Change the Windows char <-> UTF-8 conversion functions to return an allocated copy of the passed in string instead of the original. Prior to this change the curlx_convert_ functions would, as what I assume was an optimization, not make a copy of the passed in string if no conversion was required. No conversion is required in non-UNICODE Windows builds since our tchar strings are type char and remain in whatever the passed in encoding is, which is assumed to be UTF-8 but may be other encoding. In contrast the UNICODE Windows builds require conversion (wchar <-> char) and do return a copy. That inconsistency could lead to programming errors where the developer expects a copy, and does not realize that won't happen in all cases. Closes https://github.com/curl/curl/pull/6602
* http: add new files missed from referrer commitViktor Szakats2021-02-192-0/+118
| | | | | Ref: 44872aefc2d54f297caf2b0cc887df321bc9d791 Ref: #6591
* http: add support to read and store the referrer headerViktor Szakats2021-02-1915-11/+35
| | | | | | | | | - add CURLINFO_REFERER libcurl option - add --write-out '%{referer}' command-line option - extend --xattr command-line option to fill user.xdg.referrer.url extended attribute with the referrer (if there was any) Closes #6591
* urldata: remove the _ORIG suffix from string namesDaniel Stenberg2021-02-1912-82/+83
| | | | | | It doesn't provide any useful info but only makes the names longer. Closes #6624
* url: fix memory leak if OOM in the HSTS handlingDaniel Stenberg2021-02-191-1/+3
| | | | | | | Reported-by: Viktor Szakats Bug: https://github.com/curl/curl/pull/6627#issuecomment-781626205 Closes #6628
* gnutls: assume nettle crypto supportDaniel Stenberg2021-02-186-212/+24
| | | | | | | nettle has been the default crypto library with GnuTLS since 2010. By dropping support for the previous libcrypto, we simplify code. Closes #6625
* asyn-ares: use consistent resolve error messageDaniel Stenberg2021-02-184-38/+34
| | | | | | | | | | | ... with the help of Curl_resolver_error() which now is moved from asyn-thead.c and is provided globally for this purpose. Follow-up to 35ca04ce1b77636 Makes test 1188 work for c-ares builds Closes #6626
* ci: stop building on freebsd-12-1Viktor Szakats2021-02-181-1/+0
| | | | | | | | | | | | | | | | | | | An updated freebsd-12-2 image was added a few months ago, and this older one is consistently failing to go past `pkginstall`: ``` Newer FreeBSD version for package py37-mlt: To ignore this error set IGNORE_OSVERSION=yes - package: 1202000 - running kernel: 1201000 Ignore the mismatch and continue? [Y/n]: pkg: repository FreeBSD contains packages for wrong OS version: FreeBSD:12:amd64 ``` FreeBSD thread suggests that 12.1 is EOL, and best to avoid. Ref: https://forums.freebsd.org/threads/78856/ Reviewed-by: Daniel Stenberg Closes #6622
* test1188: change error from connect to resolve errorDaniel Stenberg2021-02-181-2/+2
| | | | | | | | | | | | Using the %NOLISTENPORT to trigger a connection failure is somewhat "risky" (since it isn't guaranteed to not be listened to) and caused occasional CI problems. This fix changes the infused error to be a more reliable one but still verifies the --write-out functionality properly - which is the purpose of this test. Reported-by: Jay Satiro Fixes #6621 Closes #6623
* url.c: use consistent error message for failed resolveDaniel Stenberg2021-02-181-1/+1
|
* BUGS: language polishDaniel Stenberg2021-02-181-8/+8
|
* wolfssl: don't store a NULL sessionidDaniel Stenberg2021-02-171-21/+21
| | | | | | | | | | This caused a memory leak as the session id cache entry was still erroneously stored with a NULL sessionid and that would later be treated as not needed to get freed. Reported-by: Gisle Vanem Fixes #6616 Closes #6617
* parse_proxy: fix a memory leak in the OOM pathDaniel Stenberg2021-02-171-6/+13
| | | | | | | | | Reported-by: Jay Satiro Reviewed-by: Jay Satiro Reviewed-by: Emil Engler Closes #6614 Bug: https://github.com/curl/curl/pull/6591#issuecomment-780396541
* url: fix possible use-after-free in default protocolJay Satiro2021-02-171-5/+4
| | | | | | | | | | | Prior to this change if the user specified a default protocol and a separately allocated non-absolute URL was used then it was freed prematurely, before it was then used to make the replacement URL. Bug: https://github.com/curl/curl/issues/6604#issuecomment-780138219 Reported-by: arvids-kokins-bidstack@users.noreply.github.com Closes https://github.com/curl/curl/pull/6613
* multi: rename the multi transfer statesDaniel Stenberg2021-02-163-139/+134
| | | | | | | | | | While working on documenting the states it dawned on me that step one is to use more descriptive names on the states. This also changes prefix on the states to make them shorter in the source. State names NOT ending with *ing are transitional ones. Closes #6612
* http: do not add a referrer header with empty valueViktor Szakats2021-02-161-1/+2
| | | | | | | | | | Previously an empty 'Referer:' header was added to the HTTP request when passing `--referer ';auto'` or `--referer ''` on the command-line. This patch makes `--referer` work like `--header 'Referer:'` and will only add the header if it has a non-zero length value. Reviewed-by: Jay Satiro Closes #6610
* lib: remove 'conn->data' completelyDaniel Stenberg2021-02-167-79/+26
| | | | | | | | The Curl_easy pointer struct entry in connectdata is now gone. Just before commit 215db086e0 landed on January 8, 2021 there were 919 references to conn->data. Closes #6608
* openldap: pass 'data' to the callbacks instead of 'conn'Daniel Stenberg2021-02-161-7/+9
|
* doh: Fix sharing user's resolve list with DOH handlesJay Satiro2021-02-151-0/+1
| | | | | | | | | | | | | | | | | | | - Share the shared object from the user's easy handle with the DOH handles. Prior to this change if the user had set a shared object with shared cached DNS (CURL_LOCK_DATA_DNS) for their easy handle then that wasn't used by any associated DOH handles, since they used the multi's default hostcache. This change means all the handles now use the same hostcache, which is either the shared hostcache from the user created shared object if it exists or if not then the multi's default hostcache. Reported-by: Manuj Bhatia Fixes https://github.com/curl/curl/issues/6589 Closes https://github.com/curl/curl/pull/6607
* http2: remove conn->data useDaniel Stenberg2021-02-154-40/+67
| | | | | | | | | | | | ... but instead use a private alternative that points to the "driving transfer" from the connection. We set the "user data" associated with the connection to be the connectdata struct, but when we drive transfers the code still needs to know the pointer to the transfer. We can change the user data to become the Curl_easy handle, but with older nghttp2 version we cannot dynamically update that pointer properly when different transfers are used over the same connection. Closes #6520
* openssl: remove conn->data useDaniel Stenberg2021-02-151-13/+21
| | | | | | | | | | | | | | We still make the trace callback function get the connectdata struct passed to it, since the callback is anchored on the connection. Repeatedly updating the callback pointer to set 'data' with SSL_CTX_set_msg_callback_arg() doesn't seem to work, probably because there might already be messages in the queue with the old pointer. This code therefore makes sure to set the "logger" handle before using OpenSSL calls so that the right easy handle gets used for tracing. Closes #6522
* RELEASE-NOTES: syncedDaniel Stenberg2021-02-151-8/+14
|
* doh: add options to disable ssl verificationJay Satiro2021-02-1422-44/+404
| | | | | | | | | | | | | | | | | | | | | | - New libcurl options CURLOPT_DOH_SSL_VERIFYHOST, CURLOPT_DOH_SSL_VERIFYPEER and CURLOPT_DOH_SSL_VERIFYSTATUS do the same as their respective counterparts. - New curl tool options --doh-insecure and --doh-cert-status do the same as their respective counterparts. Prior to this change DOH SSL certificate verification settings for verifyhost and verifypeer were supposed to be inherited respectively from CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER, but due to a bug were not. As a result DOH verification remained at the default, ie enabled, and it was not possible to disable. This commit changes behavior so that the DOH verification settings are independent and not inherited. Ref: https://github.com/curl/curl/pull/4579#issuecomment-554723676 Fixes https://github.com/curl/curl/issues/4578 Closes https://github.com/curl/curl/pull/6597
* hostip: fix crash in sync resolver builds that use DOHJay Satiro2021-02-131-4/+4
| | | | | | | | | | | | | | | - Guard some Curl_async accesses with USE_CURL_ASYNC instead of !CURLRES_SYNCH. This is another follow-up to 8335c64 which moved the async struct from the connectdata struct into the Curl_easy struct. A previous follow-up 6cd167a fixed building for sync resolver by guarding some async struct accesses with !CURLRES_SYNCH. The problem is since DOH (DNS-over-HTTPS) is available as an asynchronous secondary resolver the async struct may be used even when libcurl is built for the sync resolver. That means that CURLRES_SYNCH and USE_CURL_ASYNC may be defined at the same time. Closes https://github.com/curl/curl/pull/6603
* KNOWN_BUGS: cannot enable LDAPS on Windows with cmakeDaniel Stenberg2021-02-131-0/+5
| | | | | Reported-by: Jack Boos Yu Closes #6284
* KNOWN_BUGS: Excessive HTTP/2 packets with TCP_NODELAYDaniel Stenberg2021-02-131-0/+11
| | | | | Reported-by: Alex Xu Closes #6363
* http: use credentials from transfer, not connectionDaniel Stenberg2021-02-1312-112/+211
| | | | | | | | | | | | | | | | | | | HTTP auth "accidentally" worked before this cleanup since the code would always overwrite the connection credentials with the credentials from the most recent transfer and since HTTP auth is typically done first thing, this has not been an issue. It was still wrong and subject to possible race conditions or future breakage if the sequence of functions would change. The data.set.str[] strings MUST remain unmodified exactly as set by the user, and the credentials to use internally are instead set/updated in state.aptr.* Added test 675 to verify different credentials used in two requests done over a reused HTTP connection, which previously behaved wrongly. Fixes #6542 Closes #6545
* test433: clear some home dir env variablesDaniel Stenberg2021-02-121-0/+2
| | | | | | | | | | Follow-up to bd6b54ba1f55b5 ... so that XDG_CONFIG_HOME is the only home dir variable set and thus used correctly in the test! Fixes #6599 Closes #6600
* RELEASE-NOTES: syncedDaniel Stenberg2021-02-122-11/+32
| | | | bumped the version to 7.76.0