diff options
author | dartraiden <wowemuh@gmail.com> | 2020-12-12 21:52:50 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2020-12-12 21:52:50 +0300 |
commit | 3b96a0dcef3c7e1de852025cfea5a9e56486021c (patch) | |
tree | e0f3d4006a618993b1c70f507cc32c707db5e73b /libs/libcurl | |
parent | 346d20620a22103175778d0ae96299af9f93c7ea (diff) |
libcurl: update to 7.74.0
Diffstat (limited to 'libs/libcurl')
328 files changed, 3316 insertions, 2592 deletions
diff --git a/libs/libcurl/docs/CHANGES b/libs/libcurl/docs/CHANGES index b5bc305951..56859b4993 100644 --- a/libs/libcurl/docs/CHANGES +++ b/libs/libcurl/docs/CHANGES @@ -6,6 +6,1222 @@ Changelog +Version 7.74.0 (9 Dec 2020) + +Daniel Stenberg (9 Dec 2020) +- RELEASE-NOTES: synced + + for 7.74.0 + +Jay Satiro (7 Dec 2020) +- [Jacob Hoffman-Andrews brought this change] + + urldata: restore comment on ssl_connect_data.use + + This comment was originally on the `use` field, but was separated from + its field in 62a2534. + + Closes https://github.com/curl/curl/pull/6287 + +Daniel Stenberg (7 Dec 2020) +- VERSIONS: refreshed + + We always use the patch number these days: all releases are + "major.minor.patch" + +- [Jakub Zakrzewski brought this change] + + cmake: don't use reserved target name 'test' + + CMake up to 3.10 always reserves this name + + Fixes #6257 + Closes #6258 + +- openssl: make the OCSP verification verify the certificate id + + CVE-2020-8286 + + Reported by anonymous + + Bug: https://curl.se/docs/CVE-2020-8286.html + +- ftp: make wc_statemach loop instead of recurse + + CVE-2020-8285 + + Fixes #6255 + Bug: https://curl.se/docs/CVE-2020-8285.html + Reported-by: xnynx on github + +- ftp: CURLOPT_FTP_SKIP_PASV_IP by default + + The command line tool also independently sets --ftp-skip-pasv-ip by + default. + + Ten test cases updated to adapt the modified --libcurl output. + + Bug: https://curl.se/docs/CVE-2020-8284.html + CVE-2020-8284 + + Reported-by: Varnavas Papaioannou + +- urlapi: don't accept blank port number field without scheme + + ... as it makes the URL parser accept "very-long-hostname://" as a valid + host name and we don't want that. The parser now only accepts a blank + (no digits) after the colon if the URL starts with a scheme. + + Reported-by: d4d on hackerone + + Closes #6283 + +- Revert "multi: implement wait using winsock events" + + This reverts commit d2a7d7c185f98df8f3e585e5620cbc0482e45fac. + + This commit also reverts the subsequent follow-ups to that commit, which + were all done within windows #ifdefs that are removed in this + change. Marc helped me verify this. + + Fixes #6146 + Closes #6281 + +- [Klaus Crusius brought this change] + + ftp: retry getpeername for FTP with TCP_FASTOPEN + + In the case of TFO, the remote host name is not resolved at the + connetion time. + + For FTP that has lead to missing hostname for the secondary connection. + Therefore the name resolution is done at the time, when FTP requires it. + + Fixes #6252 + Closes #6265 + Closes #6282 + +- [Thomas Danielsson brought this change] + + scripts/completion.pl: parse all opts + + For tab-completion it may be preferable to include all the + available options. + + Closes #6280 + +- RELEASE-NOTES: synced + +- openssl: use OPENSSL_init_ssl() with >= 1.1.0 + + Reported-by: Kovalkov Dmitrii and Per Nilsson + Fixes #6254 + Fixes #6256 + Closes #6260 + +- SECURITY-PROCESS: disclose on hackerone + + Once a vulnerability has been published, the hackerone issue should be + disclosed. For tranparency. + + Closes #6275 + +Marc Hoersken (3 Dec 2020) +- tests/util.py: fix compatibility with Python 2 + + Backporting the Python 3 implementation of setStream + to ClosingFileHandler as a fallback within Python 2. + + Reported-by: Jay Satiro + + Fixes #6259 + Closes #6270 + +Daniel Gustafsson (3 Dec 2020) +- docs: fix typos and markup in ETag manpage sections + + Reported-by: emanruse on github + Fixes #6273 + +Daniel Stenberg (2 Dec 2020) +- quiche: close the connection + + Reported-by: Junho Choi + Fixes #6213 + Closes #6217 + +Jay Satiro (2 Dec 2020) +- ngtcp2: Fix build error due to symbol name change + + - NGTCP2_CRYPTO_LEVEL_APP -> NGTCP2_CRYPTO_LEVEL_APPLICATION + + ngtcp2/ngtcp2@76232e9 changed the name. + + ngtcp2 master is required to build curl with http3 support. + + Closes https://github.com/curl/curl/pull/6271 + +Daniel Stenberg (1 Dec 2020) +- [Klaus Crusius brought this change] + + cmake: check for linux/tcp.h + + The HAVE_LINUX_TCP_H define was not set by cmake. + + Closes #6252 + +- NEW-PROTOCOL: document what needs to be done to add one + + Closes #6263 + +- splay: rename Curl_splayremovebyaddr to Curl_splayremove + + ... and remove the old unused proto for the old Curl_splayremove + version. + + Closes #6269 + +- openssl: free mem_buf in error path + + To fix a memory-leak. + + Closes #6267 + +- openssl: remove #if 0 leftover + + Follow-up to 4c9768565ec3a9 (from Sep 2008) + + Closes #6268 + +- ntlm: avoid malloc(0) on zero length user and domain + + ... and simplify the too-long checks somewhat. + + Detected by OSS-Fuzz + + Closes #6264 + +- RELEASE-NOTES: synced + +Marc Hoersken (28 Nov 2020) +- tests/server/tftpd.c: close upload file in case of abort + + Commit c353207 removed the closing right after do_tftp + which covered the case of abort. This handles that case. + + Reviewed-by: Jay Satiro + Reviewed-by: Daniel Stenberg + + Follow up to #6209 + Closes #6234 + +Daniel Stenberg (26 Nov 2020) +- [Daiki Ueno brought this change] + + ngtcp2: use the minimal version of QUIC supported by ngtcp2 + + Closes #6250 + +- [Daiki Ueno brought this change] + + ngtcp2: advertise h3 ALPN unconditionally + + Closes #6250 + +- [Daiki Ueno brought this change] + + vquic/ngtcp2.h: define local_addr as sockaddr_storage + + This field needs to be wide enough to hold sockaddr_in6 when + connecting via IPv6. Otherwise, ngtcp2_conn_read_pkt will drop the + packets because of the address mismatch: + I00000022 [...] con ignore packet from unknown path + + We can safely assume that struct sockaddr_storage is available, as it + is used in the public interface of ngtcp2. + + Closes #6250 + +- socks: check for DNS entries with the right port number + + The resolve call is done with the right port number, but the subsequent + check used the wrong one, which then could find a previous resolve which + would return and leave the fresh resolve "incomplete" and leaking + memory. + + Fixes #6247 + Closes #6253 + +- curl_setup: USE_RESOLVE_ON_IPS is for Apple native resolver use + + ... so don't define it when instructed to use c-ares! + +- test506: make it not run in c-ares builds + + As the asynch nature of it may trigger events in another order. A c-ares + upgrade made it break. + + Reported-by: Marc Hörsken + Fixes #6247 + +- runtests: make 'c-ares' a "feature" to depend on + + ... also added to the docs. + +- tool_writeout: use off_t getinfo-types instead of doubles + + Commit 3b80d3ca46b12e52342 (June 2017) introduced getinfo replacement + variables that use curl_off_t instead of doubles. Switch the --write-out + function over to use them. + + Closes #6248 + +- [Emil Engler brought this change] + + file: avoid duplicated code sequence + + file_disconnect() is identical with file_do() except the function header + but as the arguments are unused anyway so why not just return file_do() + directly! + + Reviewed-by: Daniel Stenberg + Closes #6249 + +- [Rikard Falkeborn brought this change] + + infof/failf calls: fix format specifiers + + Update a few format specifiers to match what is being printed. + + Closes #6241 + +- docs/INTERNALS: remove reference to Curl_sendf() + + The function has been removed from common usage. Also removed comment in + gopher.c that still referenced it. + + Reported-by: Rikard Falkeborn + Fixes #6242 + Closes #6243 + +- [Rikard Falkeborn brought this change] + + examples: update .gitignore + + Add files that are generated by 'make examples' and remove some that + have been renamed. + + The commits that renamed the programs are e9625c5bc6c046a (imap.c and + simplesmtp.c were renamed to imap-fetch.c and smtp-send.c) and + ad39e7ec01e7 (pop3slist.c and pop3s.c were renamed to pop3-list.c and + pop3-ssl.c). + + Closes #6240 + +- asyn: use 'struct thread_data *' instead of 'void *' + + To reduce use of types that can't be checked at compile time. Also + removes several typecasts. + + ... and rename the struct field from 'os_specific' to 'tdata'. + + Closes #6239 + Reviewed-by: Jay Satiro + +Viktor Szakats (23 Nov 2020) +- Makefile.m32: add support for UNICODE builds + + It requires the linker to support the `-municode` option. + This is available in more recent mingw-w64 releases. + + Ref: https://gcc.gnu.org/onlinedocs/gcc/x86-Windows-Options.html + Ref: https://stackoverflow.com/questions/3571250/wwinmain-unicode-and-mingw/11706847#11706847 + + Reviewed-by: Jay Satiro + Reviewed-by: Marcel Raad + + Closes #6228 + +Daniel Stenberg (23 Nov 2020) +- urldata: remove 'void *protop' and create the union 'p' + + ... to avoid the use of 'void *' for the protocol specific structs done + per transfer. + + Closes #6238 + +- winbuild: remove docs from Makefiles and refer to README.md + + Reduce risk for conflicting docs and makes it to a single place to fix + and polish. + + add these missing options to the readme: + + ENABLE_OPENSSL_AUTO_LOAD_CONFIG and ENABLE_UNICODE + + clarify ENABLE_SCHANNEL default varies + + Fixes #6216 + Closes #6227 + Co-Authored-by: Jay Satiro + +- [Daiki Ueno brought this change] + + http3: use the master branch of GnuTLS for testing + + Closes #6235 + +- KNOWN_BUGS: curl with wolfSSL lacks support for renegotiation + + Closes #5839 + +- KNOWN_BUGS: wakeup socket disconnect causes havoc + + Closes #6132 + Closes #6133 + +- RELEASE-NOTES: synced + +- [Oliver Urbann brought this change] + + curl: add compatibility for Amiga and GCC 6.5 + + Changes are mainly reordering and adding of includes required + to compile with a more recent version of GCC. + + Closes #6220 + +Marc Hoersken (20 Nov 2020) +- tests/server/tftpd.c: close upload file right after transfer + + Make sure uploaded file is no longer locked after the + transfer while waiting for the final ACK to be handled. + + Assisted-by: Daniel Stenberg + + Bug: #6058 + Closes #6209 + +- CI/cirrus: simplify logic for disabled tests + + The OpenSSH server instance for the testsuite cannot + be started on FreeBSD, therefore the SFTP and SCP + tests are disabled right away from the beginning. + + The previous OS version specific logic for SKIP_TESTS + is no longer needed/used and can therefore be removed. + + Reviewed-by: Daniel Stenberg + + Follow up to #6211 + Closes #6229 + +Daniel Gustafsson (20 Nov 2020) +- mailmap: Daniel Hwang + + Add Daniel Hwang to the mailmap to cover the alternative spelling + Daniel Lee Hwang which was used in one commit. + + Closes #6230 + Reviewed-by: Daniel Stenberg <daniel@haxx.se> + +- openssl: guard against OOM on context creation + + EVP_MD_CTX_create will allocate memory for the context and returns + NULL in case the allocation fails. Make sure to catch any allocation + failures and exit early if so. + + In passing, also move to EVP_DigestInit rather than EVP_DigestInit_ex + as the latter is intended for ENGINE selection which we don't do. + + Closes #6224 + Reviewed-by: Daniel Stenberg <daniel@haxx.se> + Reviewed-by: Emil Engler <me@emilengler.com> + +Daniel Stenberg (19 Nov 2020) +- [Vincent Torri brought this change] + + cmake: use libcurl.rc in all Windows builds + + Reviewed-by: Marcel Raad + Closes #6215 + +- [Cristian Morales Vega brought this change] + + cmake: make CURL_ZLIB a tri-state variable + + By differentiating between ON and AUTO it can make a missing zlib + library a hard error when CURL_ZLIB=ON is used. + + Reviewed-by: Jakub Zakrzewski + Closes #6221 + Fixes #6173 + +- quiche: remove 'static' from local buffer + + For thread-safety + + Closes #6223 + +- KNOWN_BUGS: cmake: libspsl is not supported + + Closes #6214 + +- KNOWN_BUGS: cmake autodetects cert paths when cross-compiling + + Closes #6178 + +- KNOWN_BUGS: cmake build doesn't fail if zlib not found + + Closes #6173 + +- KNOWN_BUGS: cmake libcurl.pc uses absolute library paths + + Closes #6169 + +- KNOWN_BUGS: cmake: generated .pc file contains strange entries + + Closes #6167 + +- KNOWN_BUGS: cmake uses -lpthread instead of Threads::Threads + + Closes #6166 + +- KNOWN_BUGS: cmake build in Linux links libcurl to libdl + + Closes #6165 + +- KNOWN_BUGS: make a new section for cmake topics + + Closes #6219 + +- [Emil Engler brought this change] + + cirrus: build with FreeBSD 12.2 in CirrusCI + + Closes #6211 + +Marc Hoersken (14 Nov 2020) +- tests/*server.py: close log file after each log line + + Make sure the log file is not locked once a test has + finished and align with the behavior of our logmsg. + + Rename curl_test_data.py to be a general util.py. + Format and sort Python imports with isort/VSCode. + + Bug: #6058 + Closes #6206 + +Daniel Stenberg (13 Nov 2020) +- CURLOPT_HSTS.3: document the file format + + Closes #6205 + +- RELEASE-NOTES: synced + +- release-notes.pl: detect #[number] better for Ref: etc + +- curl: only warn not fail, if not finding the home dir + + ... as there's no good reason to error out completely. + + Reported-by: Andreas Fischer + Fixes #6200 + Closes #6201 + +- httpput-postfields.c: new example doing PUT with POSTFIELDS + + Proposed-by: Jeroen Ooms + Ref: #6186 + Closes #6188 + +- [Tobias Hieta brought this change] + + cmake: correctly handle linker flags for static libs + + curl CMake was setting the the EXE flags for static libraries which made + the /manifest:no flag ended up when linking the static library, which is + not a valid flag for lib.exe or llvm-lib.exe and caused llvm-lib to exit + with an error. + + The better way to handle this is to make sure that we pass the correct + linker flags to CMAKE_STATIC_LINKER_FLAGS instead. + + Reviewed-by: Jakub Zakrzewski + Closes #6195 + +- [Tobias Hieta brought this change] + + cmake: don't pass -fvisibility=hidden to clang-cl on Windows + + When using clang-cl on windows -fvisibility=hidden is not an known + argument. Instead it behaves exactly like MSVC in this case. So let's + make sure we take that path. + + In CMake clang-cl sets both CMAKE_C_COMPILER_ID=clang and MSVC get's + defined since clang-cl is basically a MSVC emulator. So guarding like we + do in this patch seems logical. + + Reviewed-by: Jakub Zakrzewski + Closes #6194 + +- http_proxy: use enum with state names for 'keepon' + + To make the code clearer, change the 'keepon' from an int to an enum + with better state names. + + Reported-by: Niranjan Hasabnis + Bug: https://curl.se/mail/lib-2020-11/0026.html + Closes #6193 + +- curl_easy_escape: limit output string length to 3 * max input + + ... instead of the limiting it to just the max input size. As every + input byte can be expanded to 3 output bytes, this could limit the input + string to 2.66 MB instead of the intended 8 MB. + + Reported-by: Marc Schlatter + Closes #6192 + +- docs: document the 8MB input string limit + + for curl_easy_escape and curl_easy_setopt() + + The limit is there to catch mistakes and abuse. It is meant to be large + enough to allow virtually all "fine" use cases. + + Reported-by: Marc Schlatter + Fixes #6190 + Closes #6191 + +- mqttd: fclose test file when done + + Reported-by: Marc Hörsken + Reviewed-by: Jay Satiro + Bug: #6058 + Closes #6189 + +- RELEASE-NOTES: synced + +- THANKS-filter: ignore autobuild links + +- Revert "libcurl.pc: make it relocatable" + + This reverts commit 3862c37b6373a55ca704171d45ba5ee91dec2c9f. + + That fix should either be done differently or with an option. + + Reported-by: asavah on github + Fixes #6157 + Closes #6183 + +- examples/httpput: remove use of CURLOPT_PUT + + It is deprecated and unnecessary since it already sets CURLOPT_UPLOAD. + + Reported-by: Jeroen Ooms + Fixes #6186 + Closes #6187 + +- Curl_pgrsStartNow: init speed limit time stamps at start + + By setting the speed limit time stamps unconditionally at transfer + start, we can start off a transfer without speed limits and yet allow + them to get set during transfer and have an effect. + + Reported-by: Kael1117 on github + Fixes #6162 + Closes #6184 + +- ngtcp2: adapt to recent nghttp3 updates + + 'reset_stream' was added to the nghttp3_conn_callbacks struct + + Closes #6185 + +- configure: pass -pthread to Libs.private for pkg-config + + Reported-by: Cristian Morales Vega + Fixes #6168 + Closes #6181 + +- altsvc: minimize variable scope and avoid "DEAD_STORE" + + Closes #6182 + +- FAQ: remove "Why is there a HTTP/1.1 in my HTTP/2 request?" + + This hasn't been the case for a while now, remove. + +- FAQ: refresh "Why do I get "certificate verify failed" + + Add more details, remove references to ancient curl version. + +- test493: verify --hsts upgrade and that %{url_effective} reflects that + + Closes #6175 + +- url: make sure an HSTS upgrade updates URL and scheme correctly + + Closes #6175 + +- tool_operate: set HSTS with CURLOPT_HSTS to pass on filename + + Closes #6175 + +- hsts: remove debug code leftovers + + Closes #6175 + +- FAQ: refreshed + + - remove a few ancient questions + - add configure with static libs question + - updated wording in several places + - lowercased curl + + Closes #6177 + +Daniel Gustafsson (5 Nov 2020) +- examples: fix comment syntax + + Commit ac0a88fd2 accidentally added a stray character outside of the + comment which broke compilation. Fix by removing. + + Reported-by: autobuild https://curl.se/dev/log.cgi?id=20201105084306-12742 + +- hsts: Remove pointless call to free in errorpath + + The line variable will always be NULL in the error path, so remove + the free call since it's pointless. + + Closes #6170 + Reviewed-by: Daniel Stenberg <daniel@haxx.se> + +- docs: Fix various typos in documentation + + Closes #6171 + Reviewed-by: Daniel Stenberg <daniel@haxx.se> + +Daniel Stenberg (5 Nov 2020) +- copyright: fix year ranges + + Follow-up from 4d2f8006777 + +- HISTORY: the new domain + +- curl.se: new home + + Closes #6172 + +- KNOWN_BUGS: FTPS with Schannel times out file list operation + + Reported-by: bobmitchell1956 on github + Closes #5284 + +- KNOWN_BUGS: SMB tests fail with Python 2 + + Reported-by: Jay Satiro + Closes #5983 + +- KNOWN_BUGS: LDAPS with NSS is slow + + Reported-by: nosajsnikta on github + Closes #5874 + +Sergei Nikulov (4 Nov 2020) +- travis: use ninja-build for CMake builds + + Added package ninja-build to environment + Use ninja to speed up CMake builds + + Closes #6077 + +Daniel Stenberg (4 Nov 2020) +- [Harry Sintonen brought this change] + + rtsp: error out on empty Session ID, unified the code + +- [Harry Sintonen brought this change] + + rtsp: fixed the RTST Session ID mismatch in test 570 + + Closes #6161 + +- [Harry Sintonen brought this change] + + rtsp: fixed Session ID comparison to refuse prefix + + Closes #6161 + +- RELEASE-NOTES: synced + + (forgot to update the list of contributors) + +- RELEASE-NOTES: synced + +- curlver: bumped to 7.74.0 + +- hsts: add read/write callbacks + + - read/write callback options + - man pages for the 4 new setopts + - test 1915 verifies the callbacks + + Closes #5896 + +- hsts: add support for Strict-Transport-Security + + - enable in the build (configure) + - header parsing + - host name lookup + - unit tests for the above + - CI build + - CURL_VERSION_HSTS bit + - curl_version_info support + - curl -V output + - curl-config --features + - CURLOPT_HSTS_CTRL + - man page for CURLOPT_HSTS_CTRL + - curl --hsts (sets CURLOPT_HSTS_CTRL and works with --libcurl) + - man page for --hsts + - save cache to disk + - load cache from disk + - CURLOPT_HSTS + - man page for CURLOPT_HSTS + - added docs/HSTS.md + - fixed --version docs + - adjusted curl_easy_duphandle + + Closes #5896 + +- [Sergei Nikulov brought this change] + + CI/tests: enable test target on TravisCI for CMake builds + + Added test-nonflaky target to CMake builds + + Disabled test 1139 because the cmake build doesn't create docs/curl.1 + + Closes #6074 + +- tool_debug_cb: do not assume zero-terminated data + + Follow-up to d70a5b5a0f5e3 + +- sendf: move the verbose-check into Curl_debug + + Saves us from having the same check done everywhere. + + Closes #6159 + +- travis: use valgrind when running tests for debug builds + + Except the non-x86 and sanitizer builds + + Closes #6154 + +- header.d: fix syntax mistake + + follow-up from 1144886f38fd0 + +- [Harry Sintonen brought this change] + + gnutls: fix memory leaks (certfields memory wasn't released) + + Closes #6153 + +- tests: add missing global_init/cleanup calls + + Without the cleanup call in these test files, the mbedTLS backend leaks + memory. + + Closes #6156 + +- tool_operate: --retry for HTTP 408 responses too + + This was inadvertently dropped from the code when the parallel support + was added. + + Regression since b88940850 (7.66.0) + + Reviewed-by: Jay Satiro + Closes #6155 + +- http: pass correct header size to debug callback for chunked post + + ... when the chunked framing was added, the size of the "body part" of + the data was calculated wrongly so the debug callback would get told a + header chunk a few bytes too big that would also contain the first few + bytes of the request body. + + Reported-by: Dirk Wetter + Ref: #6144 + Closes #6147 + +- header.d: mention the "Transfer-Encoding: chunked" handling + + Ref: #6144 + Closes #6148 + +- acinclude: detect manually set minimum macos/ipod version + + ... even if set in the CC or IPHONEOS/MACOSX_DEPLOYMENT_TARGET + variables. + + Reported-by: hamstergene on github + Fixes #6138 + Closes #6140 + +Jay Satiro (29 Oct 2020) +- tests: fix some http/2 tests for older versions of nghttpx + + - Add regex that strips http/2 server header name to those http/2 tests + that don't already have it. + + - Improve that regex in all http/2 tests. + + Tests 358 and 359 were failing for me before this change on a system + that uses an older version of nghttpx which includes its version number + in the server header. + + Closes https://github.com/curl/curl/pull/6139 + +Daniel Stenberg (30 Oct 2020) +- RELEASE-NOTES: synced + +- [Cristian Morales Vega brought this change] + + configure: use pkgconfig to find openSSL when cross-compiling + + This reverts 736a40fec (November 2004), which doesn't explain why it was + done. + + Closes #6145 + +- tool_operate: bail out proper on errors for parallel setup + + ... otherwise for example trying to upload a missing file just causes a + loop. + + Reported-by: BrumBrum on hackerone + Closes #6141 + +- [Sergei Nikulov brought this change] + + CMake: make BUILD_TESTING dependent option + + CMake will now handle BUILD_TESTING depending on PERL_FOUND and + CURL_DISABLE_TESTING + + Ref: #6036 + Closes #6072 + +- libssh2: fix transport over HTTPS proxy + + The fix in #6021 was not enough. This fix makes sure SCP/SFTP content + can also be transfered over a HTTPS proxy. + + Fixes #6113 + Closes #6128 + +- curl.1: add an "OUTPUT" section at the top of the manpage + + Explain the basic concepts behind curl output. + + Inspired by #6124 + + Closes #6134 + +- mailmap: set Viktor Szakats's email + +- runtests: show keywords when no tests ran + + To help out future debugging, runtests now outputs the list of keywords + when it fails because no tests ran. + + Ref: #6120 + Closes #6126 + +Jay Satiro (26 Oct 2020) +- CURLOPT_DNS_USE_GLOBAL_CACHE.3: fix typo + + Reported-by: Rui LIU + + Closes https://github.com/curl/curl/issues/6131 + +- range.d: fix typo + + Follow-up to 15ae039 from earlier today. + +Daniel Stenberg (26 Oct 2020) +- CI/github: work-around for brew breakage on macOS + + ... and make it use OpenSSL 1.1 properly + + Fixes #6130 + Closes #6129 + +- [José Joaquín Atria brought this change] + + range.d: clarify that curl will not parse multipart responses + + Closes #6127 + Fixes #6124 + +- RELEASE-NOTES: synced + +- [Baruch Siach brought this change] + + libssh2: fix build with disabled proxy support + + Build breaks because the http_proxy field is missing: + + vssh/libssh2.c:3119:10: error: 'struct connectdata' has no member named 'http_proxy' + + Regression from #6021, shipped in curl 7.73.0 + + Closes #6125 + +- alt-svc: enable by default + + Remove CURLALTSVC_IMMEDIATELY, which was never implemented/supported. + + alt-svc support in curl is no longer considered experimental + + Closes #5868 + +- CI/appveyor: remove (unused) runtests.pl -b option + +- [Emil Engler brought this change] + + tool_help: make "output" description less confusing + + Currently the description of "output" is misleading when comparing it + "verbose". + + Closes #6118 + +- CI/appveyor: disable test 571 in two cmake builds + + ... they're simply too flaky there. + + Closes #6119 + +- cmake: set the unicode feature in curl-config on Windows + + ... if built that way. To make it match curl -V output. + + Reviewed-by: Marcel Raad + Closes #6117 + +- libssh2: require version 1.0 or later + + ... and simplify the code accordingly. libssh2 version 1.0 was released + in April 2009. + + Closes #6116 + +- KNOWN_BUGS: mention the individual cmake issues + + ... to make them easier to refer to and address separately and + one-by-one. + +- CMake: store IDN2 information in curl_config.h + + This allows the build to enable IDN properly and it makes test 1014 + happier. + + Ref: #6074 + Closes #6108 + +- CMake: call the feature unixsockets without dash + + ... so that curl-config gets correct and makes test 1014 happy! + + Ref: #6074 + Closes #6108 + +- CI/travis: add brotli and zstd to the libssh2 build + + ... to make sure such tests are run with valgrind. Suppress the zstd + valgrind warnings we get with version 1.3.3 on Ubuntu 18.04 (for debug + and non-debug builds). + + Closes #6105 + +- runtests: revert the mistaken edit of $CURL + + Regression from c4693adc62 + +- RELEASE-NOTES: synced + +- curl_url_set.3: fix typo in the RETURN VALUE section + + Reported-by: Basuke Suzuki + Fixes #6102 + +Jay Satiro (17 Oct 2020) +- [Daniel Stenberg brought this change] + + packages/OS400: make the source code-style compliant + + ... and make sure 'make checksrc' in the root dir also verifies the + packages/OS400 sources. + + Closes https://github.com/curl/curl/pull/6085 + +- os400: Sync libcurl API options + + This fixes the OS400 build and also an incorrect entry for + CURLINFO_APPCONNECT_TIME_T where it was treated as + CURLINFO_STARTTRANSFER_TIME_T. + + Reported-by: Jon Rumsey + + Fixes https://github.com/curl/curl/issues/6083 + Closes https://github.com/curl/curl/pull/6084 + +Daniel Stenberg (16 Oct 2020) +- CURLOPT_NOBODY.3: fix typo + + Reported-by: Basuke Suzuki + Fixes #6097 + +Marc Hoersken (16 Oct 2020) +- CI/azure: improve on flakiness by avoiding libtool wrappers + + Install curl binaries into MinGW bin folder and use that + for the tests in order to avoid libtool wrapper binaries. + + The libtool wrapper binaries (not scripts) on Windows seem + to be one of the possible causes for the following issues: + + 1. Process output can be lost in the wrapper process chain. + 2. Killing the wrapper process does not kill the actual one. + + Derived from #5904 + Closes #6049 + +Daniel Stenberg (16 Oct 2020) +- CURLOPT_URL.3: clarify SCP/SFTP URLs are for uploads as well + +- [Zenju brought this change] + + CURLOPT_TCP_NODELAY.3: fix comment in example code + + Closes #6096 + +- openssl: acknowledge SRP disabling in configure properly + + Follow-up to 68a513247409 + + Use a new separate define that is the combination of both + HAVE_OPENSSL_SRP and USE_TLS_SRP: USE_OPENSSL_SRP + + Bug: https://curl.haxx.se/mail/lib-2020-10/0037.html + + Closes #6094 + +Viktor Szakats (16 Oct 2020) +- http3: fix two build errors, silence warnings + + * fix two build errors due to mismatch between function + declarations and their definitions + * silence two mismatched signs warnings via casts + + Approved-by: Daniel Stenberg + Closes #6093 + +- Makefile.m32: add support for HTTP/3 via ngtcp2+nghttp3 + + Approved-by: Daniel Stenberg + Closes #6092 + +Daniel Stenberg (16 Oct 2020) +- tool_operate: fix compiler warning when --libcurl is disabled + + Closes #6095 + +- checksrc: warn on empty line before open brace + + ... and fix a few occurances + + Closes #6088 + +- urlapi: URL encode a '+' in the query part + + ... when asked to with CURLU_URLENCODE. + + Extended test 1560 to verify. + Reported-by: Dietmar Hauser + Fixes #6086 + Closes #6087 + +- [Cristian Morales Vega brought this change] + + libcurl.pc: make it relocatable + + It supposes when people specify the libdir/includedir they do it to + change where under prefix/exec_prefix it should be, not to make it + independent of prefix/exec_prefix. + + Closes #6061 + +- runtests: return error if no tests ran + + ... and make TESTFAIL stand out a little better by adding newlines + before and after. + + Reported-by: Marc Hörsken + Issue: #6052 + Closes #6053 + +- docs/FEATURE: convert to markdown + + ... and clean it up a bit. + + Closes #6067 + +- [Philipp Klaus Krause brought this change] + + strerror: use 'const' as the string should never be modified + + Closes #6068 + +- [Jay Satiro brought this change] + + connect: repair build without ipv6 availability + + Assisted-by: Daniel Stenberg + Reported-by: Tom G. Christensen + + Fixes https://github.com/curl/curl/issues/6069 + Closes https://github.com/curl/curl/pull/6071 + +- RELEASE-NOTES: synced + + Started over for the journey to next release. + +- src/tool_filetime: disable -Wformat on mingw for this file + + With gcc 10 on mingw we otherwise get this warning: + + error: ISO C does not support the 'I' printf flag [-Werror=format=] + + Fixes #6079 + Closes #6082 + +- test122[12]: remove these two tests + + ... and remove the objnames scripts they tested. They're not used for + anything anymore so testing them serves no purpose! + + Reported-by: Marc Hörsken + Fixes #6080 + Closes #6081 + Version 7.73.0 (14 Oct 2020) Daniel Stenberg (14 Oct 2020) @@ -6222,1231 +7438,3 @@ Daniel Stenberg (26 Mar 2020) Reviewed-by: Jat Satiro Closes #5146 - -- travis: update the ngtcp2 build to use the latest OpenSSL patch - - ... which also makes it OpenSSL 1.1.1d based and not v3. - -Marc Hoersken (24 Mar 2020) -- CI: remove default Ubuntu build from GitHub Actions - - We are already running a very similar Ubuntu build on Travis CI. - The macOS variant of this default build is kept on Github Actions. - -- CI: bring GitHub Actions fuzzing job in line with macOS jobs - - Update YAML formatting, job naming and triggers. - -- CI: migrate macOS jobs from Azure and Travis CI to GitHub Actions - - Reduce workload on Azure Pipelines and Travis CI while - consolidating macOS jobs onto less utilized GitHub Actions. - - Reviewed-by: Daniel Stenberg - - Closes #5124 - -Daniel Stenberg (24 Mar 2020) -- config: remove all defines of HAVE_DES_H - - As there's no code using it. - - Closes #5144 - -- copyright: fix out-of-date copyright ranges and missing headers - - Reported by the new script 'scripts/copyright.pl'. The script has a - regex whitelist for the files that don't need copyright headers. - - Removed three (mostly usesless) README files from docs/ - - Closes #5141 - -- packages: add OS400/chkstrings.c to the dist - - Reported-by: Jon Rumsey - Fixes #5142 - Closes #5143 - -- [Clément Notin brought this change] - - nghttp2: 1.12.0 required - - since nghttp2_session_set_local_window_size is needed - - Closes #5140 - -- RELEASE-NOTES: synced - -- [Calvin Buckley brought this change] - - OS400: Update strings for ccsid-ifier - - Fixes build. - - Closes #5132 - -- cirrus: make freebsd ignore the tests instead of skipping - - To allow us to see in the CI logs how they actually behave - - Closes #5091 - -- cirrus: move the sanitizer build from freebsd 13 to freebsd 12 - -- Revert "cirrus-ci: disable the FreeBSD 13 builds" - - This reverts commit 691b71be930f0e285c8f7a76efd56bbe0576cda6. - -- getinfo: provide CURLINFO_HEADER_SIZE and CURLINFO_REQUEST_SIZE override - - To let debug-builds return fake values, like in test 970. - - Ref: #5131 - Closes #5136 - -- test970: improve the test - - - send more data to make problems more obvious - - don't start the data with minus, it makes diffs harder to read - - skip the headers in the stdout comparison - - save to a file name to also verify 'filename_effective' - - Ref: #5131 - -- CURLINFO_NUM_CONNECTS: improve accuracy - - The counter was not bumped in all cases correctly. - - Reported-by: Marcel Raad - Ref: #5131 - Closes #5135 - -- TODO: Use "random" ports for the test servers - -- lib/curl_setup: adjust the copyright year range - - Follow-up from d820224b8 - -Jay Satiro (21 Mar 2020) -- curl_setup: define _WIN32_WINNT_[OS] symbols - - .. because not all Windows build systems have those symbols, and even - those that do may be missing newer symbols (eg the Windows 7 SDK does - not define _WIN32_WINNT_WIN10). - - Those symbols are used in build-time logic to decide which API to use - and prior to this change if the symbols were missing it would have - resulted in deprecated API being used when more recent functions were - available (eg GetVersionEx used instead of VerifyVersionInfo). - - Reported-by: FuccDucc@users.noreply.github.com - - Probably fixes https://github.com/curl/curl/issues/4995 - Closes https://github.com/curl/curl/pull/5057 - -- [Ross Burton brought this change] - - curl-functions.m4: remove inappropriate AC_REQUIRE - - AC_REQUIRE means "if this macro hasn't been executed already, execute - it". So in a wrapper around AC_RUN_IFELSE, AC_REQUIRE(AC_RUN_IFELSE) - isn't correct at that will execute AC_RUN_IFELSE without any arguments. - - With autoconf 2.69 this is basically a no-op, but with autoconf 2.70, - AC_RUN_IFELSE without a default value when cross-compiling is fatal. - The result is that curl with autoconf 2.70 cannot cross-compile. - - Fixes https://github.com/curl/curl/issues/5126 - Closes https://github.com/curl/curl/pull/5130 - -Marc Hoersken (20 Mar 2020) -- ci/tests: fix Azure Pipelines not running Windows containers - - Workaround posted here: microsoft/azure-pipelines-agent#2864 - - Assisted-by: Simon Chalifoux - Assisted-by: Tommy Petty - - Fixes #5117 - Closes #5129 - -Daniel Stenberg (20 Mar 2020) -- tests: add test 430, 431 and 432 to verify the --config fix - - Verify the fixes in 4e0b4fee4 - -- [Rici Lake brought this change] - - cmdline: fix handling of OperationConfig linked list (--next) - - Ensures that -K/--config inserts new items at the end of the list - instead of overwriting the second item, and that after a -K/--config - option has been parsed, the option parser's view of the current config - is update. - - Fixes #5120 - Closes #5123 - -Marc Hoersken (20 Mar 2020) -- test2100: fix static port instead of dynamic value being used - -- test970: fix static ip:port instead of dynamic values being used - -Daniel Stenberg (19 Mar 2020) -- secure transport: remove the BACKEND define kludge - - Closes #5122 - -- mbedtls: remove the BACKEND define kludge - -- bearssl: remove the BACKEND define kludge - -- wolfssl: remove the BACKEND define kludge - -- nss: remove the BACKEND define kludge - -- gnutls: remove the BACKEND define kludge - -- openssl: remove the BACKEND define kludge - - Use a proper variable instead to make it easier to use a debugger and - read the code. - -Marc Hoersken (19 Mar 2020) -- tests: make Python-based servers compatible with Python 2 and 3 - - Update smbserver.py and negtelnetserver.py to be compatible with - Python 3 while staying backwards-compatible to support Python 2. - - Fix string encoding and handling of echoed and transferred data. - - Tested with both Python 2.7.17 and Python 3.7.7 - - Reported-by: Daniel Stenberg - Assisted-by: Kamil Dudka - Reviewed-by: Marcel Raad - - Fixes #5104 - Closes #5110 - -Daniel Stenberg (18 Mar 2020) -- writeout_json: use curl_off_t printf() option for the time output - - Follow-up to: 04c03416e68fd635a15 - - Closes #5115 - -- RELEASE-NOTES: synced - - Uh, I missed this in 1a46b218db - -- RELEASE-NOTES: synced - - ... and bumped curlver.h to 7.70.0 - -Jay Satiro (18 Mar 2020) -- http2: Fix erroneous debug message that h2 connection closed - - Prior to this change in libcurl debug builds http2 stream closure was - erroneously referred to as connection closure. - - Before: - * nread <= 0, server closed connection, bailing - - After: - * nread == 0, stream closed, bailing - - Closes https://github.com/curl/curl/pull/5118 - -Daniel Stenberg (18 Mar 2020) -- tool_setopt: correct the copyright year range - - Follow-up to 5450428491 - -Jay Satiro (18 Mar 2020) -- [Johannes Schindelin brought this change] - - schannel: add "best effort" revocation check option - - - Implement new option CURLSSLOPT_REVOKE_BEST_EFFORT and - --ssl-revoke-best-effort to allow a "best effort" revocation check. - - A best effort revocation check ignores errors that the revocation check - was unable to take place. The reasoning is described in detail below and - discussed further in the PR. - - --- - - When running e.g. with Fiddler, the schannel backend fails with an - unhelpful error message: - - Unknown error (0x80092012) - The revocation function was unable - to check revocation for the certificate. - - Sadly, many enterprise users who are stuck behind MITM proxies suffer - the very same problem. - - This has been discussed in plenty of issues: - https://github.com/curl/curl/issues/3727, - https://github.com/curl/curl/issues/264, for example. - - In the latter, a Microsoft Edge developer even made the case that the - common behavior is to ignore issues when a certificate has no recorded - distribution point for revocation lists, or when the server is offline. - This is also known as "best effort" strategy and addresses the Fiddler - issue. - - Unfortunately, this strategy was not chosen as the default for schannel - (and is therefore a backend-specific behavior: OpenSSL seems to happily - ignore the offline servers and missing distribution points). - - To maintain backward-compatibility, we therefore add a new flag - (`CURLSSLOPT_REVOKE_BEST_EFFORT`) and a new option - (`--ssl-revoke-best-effort`) to select the new behavior. - - Due to the many related issues Git for Windows and GitHub Desktop, the - plan is to make this behavior the default in these software packages. - - The test 2070 was added to verify this behavior, adapted from 310. - - Based-on-work-by: georgeok <giorgos.n.oikonomou@gmail.com> - Co-authored-by: Markus Olsson <j.markus.olsson@gmail.com> - Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> - - Closes https://github.com/curl/curl/pull/4981 - -- multi: Improve parameter check for curl_multi_remove_handle - - - If an easy handle is owned by a multi different from the one specified - then return CURLM_BAD_EASY_HANDLE. - - Prior to this change I assume user error could cause corruption. - - Closes https://github.com/curl/curl/pull/5116 - -Viktor Szakats (17 Mar 2020) -- windows: suppress UI in all CryptAcquireContext() calls - - Ref: https://docs.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecontexta#parameters - Reviewed-by: Marc Hörsken - Closes https://github.com/curl/curl/pull/5088 - -Daniel Stenberg (17 Mar 2020) -- writeout_json: add missing comma to fix the HTTP version - - Follow-up to 04c03416e68fd635a15 - -- test 970: verify --write-out '%{json}' - - Makes curl_easy_getinfo() of "variable" numerical content instead return - the number set in the env variable `CURL_TIME`. - - Makes curl_version() of "variable" textual content. This guarantees a - stable version string which can be tested against. Environment variable - `CURL_VERSION` defines the content. - - Assisted-by: Mathias Gumz - -- [Mathias Gumz brought this change] - - writeout: support to generate JSON output - - This commit adds support to generate JSON via the writeout feature: - - -w "%{json}" - - It leverages the existing infrastructure as much as possible. Thus, - generating the JSON on STDERR is possible by: - - -w "%{stderr}%{json}" - - This implements a variant of - https://github.com/curl/curl/wiki/JSON#--write-out-json. - - Closes #4870 - -- CI: stop ignoring 323, it is disabled - -- DISABLED: disable test 323 - - The test uses SRP to "a server not supporting it" but modern stunnel - versions will silently accept it and remain happy. The test is therefore - faulty. - - I haven't figured out how to make stunnel explicitly reject SRP-using - connects. - - Reported-by: Marc Hörsken - Fixes #5105 - Closes #5113 - -Marc Hoersken (17 Mar 2020) -- ci/tests: increase timeouts for torture builds on Azure Pipelines - - For some reason the torture builds have slowed down recently. - - Reported-by: Daniel Stenberg - -Daniel Stenberg (16 Mar 2020) -- cmake: add support for building with wolfSSL - - My working build cmdline: - - $ cmake -DCMAKE_PREFIX_PATH=$HOME/build-wolfssl -DCMAKE_USE_WOLFSSL=ON . - - Assisted-by: Brad King - Closes #5095 - -- tool_operate: fix add_parallel_transfers when more are in queue - - Trying to return early from the function if no new transfers were added - would break the "morep" argument and cause issues. This could lead to - zero content "transfers" (within quotes since they would never be - started) when parallel-max was reduced. - - Reported-by: Gavin Wong - Analyzed-by: Jay Satiro - Fixes #4937 - Closes #5112 - -- vtls: free ssl_config leftovers on out-of-memory - - Torture testing 2034 and 2037 found this. - - Reported-by: Marc Hörsken - Fixes #5108 - Closes #5109 - -Marc Hoersken (16 Mar 2020) -- ci/tests: fix Azure Pipelines not running for pull requests - - Closes #5111 - -Daniel Stenberg (15 Mar 2020) -- gskit: update the copyright year range - - Follow-up from 083603c63a3 - -Marc Hoersken (15 Mar 2020) -- gskit: use our internal select wrapper for portability - - Follow up to c52b342 - Closes #5106 - -- tests: fix verification of stdout in test 1452 due to newline - - Fixes test1452:41:1: error: missing </stdout> tag before </verify> - -- ci/tests: install impacket for SMB tests on FreeBSD using CirrusCI - - Also force the package index/cache to be updated before installing. - - Closes #5103 - -- tests/README: add note about manually installing python-impacket - - Follow up to 4be2560 - -Daniel Stenberg (15 Mar 2020) -- transfer: cap retries of "dead connections" to 5 - - When libcurl retries a connection due to it being "seemingly dead" or by - REFUSED_STREAM, it will now only do it up five times before giving up, - to avoid never-ending loops. - - Reported-by: Dima Tisnek - Bug: https://curl.haxx.se/mail/lib-2020-03/0044.html - Closes #5074 - -- TODO: TLS-PSK with OpenSSL - - Closes #5081 - -Marc Hoersken (15 Mar 2020) -- select: add 'timeout_ms' wrap-around precaution to Curl_select - -- select: fix 'pending_ms' is assigned a value that is never used - - Detected by Codacy - -- select: move duplicate select preparation code into Curl_select - - Reviewed by Daniel Stenberg - Reviewed by Marcel Raad - Closes #5078 - -Daniel Stenberg (15 Mar 2020) -- connect: happy eyeballs cleanup - - Make sure each separate index in connn->tempaddr[] is used for a fixed - family (and only that family) during the connection process. - - If family one takes a long time and family two fails immediately, the - previous logic could misbehave and retry the same family two address - repeatedly. - - Reported-by: Paul Vixie - Reported-by: Jay Satiro - Fixes #5083 - Fixes #4954 - Closes #5089 - -Marc Hoersken (15 Mar 2020) -- ci/tests: fix and align setting TFLAGS for make test-nonflaky - -- ci/tests: install test suite dependencies stunnel and impacket - -- tests: remove python_dependencies for smbserver from our tree - - Users of the SMB tests will have to install impacket manually. - - Reasoning: our in-tree version of impacket was quite outdated - and only compatible with Python 2 which is already end-of-life. - Upgrading to Python 3 and a compatible impacket version would - require to import additional Python-only and CPython-extension - dependencies. This would have hindered portability enormously. - - Closes #5094 - -Jay Satiro (14 Mar 2020) -- Makefile.m32: Improve windres parameter compatibility - - - s/COFF/coff/ - - Some versions of windres do not recognize uppercase COFF as a valid - way to specify the COFF output format. - - Reported-by: Steven Penny - - Fixes https://github.com/curl/curl/issues/5099 - Closes https://github.com/curl/curl/pull/5101 - -- easy: Fix curl_easy_duphandle for builds missing IPv6 that use c-ares - - - Ignore CURLE_NOT_BUILT_IN errors returned by c-ares functions in - curl_easy_duphandle. - - Prior to this change if c-ares was used as the resolver backend and - either it was too old or libcurl was built without IPv6 support then - some of our resolver functions could return CURLE_NOT_BUILT_IN to - curl_easy_duphandle causing it to fail. - - Caused by c8f086b which shipped in 7.69.1. - - Reported-by: Karl Chen - - Fixes https://github.com/curl/curl/issues/5097 - Closes https://github.com/curl/curl/pull/5100 - -Daniel Stenberg (13 Mar 2020) -- docs: add warnings about FILE: URLs on Windows - - - --url man page section - - libcurl-security.3 gets the full text - - CURLOPT_URL.3 - - Reported-by: Tim Sedlmeyer - -- server/getpart: make the "XML-parser" stricter - - When extracting a <section> <part> and there's no </part> before - </section>, this now outputs an error and returns a wrong string to - make users spot the mistake. - - Ref: #5070 - Closes #5071 - -Marc Hoersken (13 Mar 2020) -- impacket: some more Python 3 code compatibility updates - - This makes smbserver load on Python 3, but still not work completely. - -- smbserver: pin Python version to 2 since we are not yet 3 compatible - - Even though the existing code can be fixed to run on Python 3, the - tests will fail due to the Unicode transition the protocol is invalid. - - Follow up to ee63837 - Closes #5085 - -Daniel Stenberg (12 Mar 2020) -- [Viktor Szakats brought this change] - - cleanup: fix some text/comment typos - - Closes #5087 - -Marc Hoersken (12 Mar 2020) -- smbserver: fix Python version specific ConfigParser import - - Follow up to ee63837 and 8c7c4a6 - Fixes #5077 - -Daniel Stenberg (11 Mar 2020) -- RELEASE-NOTES: synced - - bumped to 7.69.2 - -Dan Fandrich (11 Mar 2020) -- tests/data: Fix some XML formatting issues in test cases - - This allows these test files to pass xmllint. - -Daniel Stenberg (11 Mar 2020) -- [Muhammad Herdiansyah brought this change] - - Makefile: run the cd commands in a subshell - - In bmake, if the directory is changed (with cd or anything else), bmake - won't return to the "root directory" on the next command (in the same - Makefile rule). This commit runs the cd command in a subshell so it - would work in bmake. - - Closes #5073 - -- configure: convert -I to -isystem as a last step - - As all the -I uses in CFLAGS at that point are for system headers and - third party libraries this helps us remove/ignore warnings on those! - - Closes #5060 - -- configure: fix -pedantic-errors for GCC 5 and later - - If --enable-werror is used. - - Follow-up to d5c0351055d5709da which added it too early in the configure - script before $compiler_num was set correctly and thus this option was - never used. - - Reported-by: Stepan Efremov - Fixes #5067 - Closes #5068 - -- configure: document 'compiler_num' for gcc - - The CURL_CHECK_COMPILER_GNU_C function sets the number to MAJOR*100 + - MINOR and ignores the patch version, and since gcc version 7 it only - sets it to MAJOR*100. - - Reported-by: Stepan Efremov - Ref: #5067 - Closes #5069 - -Version 7.69.1 (11 Mar 2020) - -Daniel Stenberg (11 Mar 2020) -- RELEASE-NOTES: 7.69.1 - -- THANKS: from the 7.69.1 release - -- [Marc Hoersken brought this change] - - test1129: fix invalid case of closing XML-tag and Content-Length - - Fixes #5070 - Closes #5072 - -Marc Hoersken (10 Mar 2020) -- tests/data: fix static ip instead of dynamic value being used - - Follow up to 94ced8e - -- tests/data: fix static ip:port instead of dynamic values being used - - Closes #5065 - -- tests/server: fix missing use of exe_ext helper function - - Follow up to 9819984 and 3dce984 - Reviewed-By: Daniel Stenberg - Closes #5064 - -- runtests: log minimal and maximal used port numbers - -Daniel Stenberg (9 Mar 2020) -- [James Fuller brought this change] - - sftp: fix segfault regression introduced by #4747 - - This fix adds a defensive check for the case where the char *name in - struct libssh2_knownhost is NULL - - Fixes #5041 - Closes #5062 - -- RELEASE-NOTES: synced - -- socks4: fix host resolve regression - - 1. The socks4 state machine was broken in the host resolving phase - - 2. The code now insists on IPv4-only when using SOCKS4 as the protocol - only supports that. - - Regression from #4907 and 4a4b63d, shipped in 7.69.0 - - Reported-by: amishmm on github - Bug: https://github.com/curl/curl/issues/5053#issuecomment-596191594 - Closes #5061 - -- [Patrick Monnerat brought this change] - - silly web server: silent a compilation warning - - Recent gcc warns when byte count of strncpy() equals the destination - buffer size. Since the destination buffer is previously cleared and - the source string is always shorter, reducing the byte count by one - silents the warning without affecting the result. - - Closes #5059 - -- [Patrick Monnerat brought this change] - - cookie: get_top_domain() sets zero length for null domains - - This silents a compilation warning with gcc -O3. - -- [Patrick Monnerat brought this change] - - test 1560: avoid valgrind false positives - - When using maximum code optimization level (-O3), valgrind wrongly - detects uses of uninitialized values in strcmp(). - - Preset buffers with all zeroes to avoid that. - -Steve Holme (8 Mar 2020) -- sha256: Added WinCrypt implementation - - Closed #5030 - -- sha256: Added SecureTransport implementation - -Daniel Stenberg (7 Mar 2020) -- lib1564: reduce number of mid-wait wakeup calls - - This test does A LOT of *wakeup() calls and then calls curl_multi_poll() - twice. The first *poll() is then expected to return early and the second - not - as the first is supposed to drain the socketpair pipe. - - It turns out however that when given "excessive" amounts of writes to - the pipe, some operating systems (the Solaris based are known) will - return EAGAIN before the pipe is drained, which in our test case causes - the second *poll() call to also abort early. - - This change attempts to avoid the OS-specific behaviors in the test by - reducing the amount of wakeup calls from 1234567 to 10. - - Reported-by: Andy Fiddaman - Fixes #5037 - Closes #5058 - -- [Patrick Monnerat brought this change] - - mime: fix the binary encoder to handle large data properly - - New test 666 checks this is effective. - As upload buffer size is significant in this kind of tests, shorten it - in similar test 652. - - Fixes #4860 - Closes #4833 - Reported-by: RuurdBeerstra on github - -- [Patrick Monnerat brought this change] - - mime: do not perform more than one read in a row - - Input buffer filling may delay the data sending if data reads are slow. - To overcome this problem, file and callback data reads do not accumulate - in buffer anymore. All other data (memory data and mime framing) are - considered as fast and still concatenated in buffer. - As this may highly impact performance in terms of data overhead, an early - end of part data check is added to spare a read call. - When encoding a part's data, an encoder may require more bytes than made - available by a single read. In this case, the above rule does not apply - and reads are performed until the encoder is able to deliver some data. - - Tests 643, 644, 645, 650 and 654 have been adapted to the output data - changes, with test data size reduced to avoid the boredom of long lists of - 1-byte chunks in verification data. - New test 667 checks mimepost using single-byte read callback with encoder. - New test 668 checks the end of part data early detection. - - Fixes #4826 - Reported-by: MrdUkk on github - -- [Patrick Monnerat brought this change] - - mime: latch last read callback status. - - In case a read callback returns a status (pause, abort, eof, - error) instead of a byte count, drain the bytes read so far but - remember this status for further processing. - Takes care of not losing data when pausing, and properly resume a - paused mime structure when requested. - New tests 670-673 check unpausing cases, with easy or multi - interface and mime or form api. - - Fixes #4813 - Reported-by: MrdUkk on github - -Marc Hoersken (7 Mar 2020) -- runtests: fix missing use of exe_ext helper function - -Daniel Stenberg (7 Mar 2020) -- [Ernst Sjöstrand brought this change] - - ares: store dns parameters for duphandle - - With c-ares the dns parameters lives in ares_channel. Store them in the - curl handle and set them again in easy_duphandle. - - Regression introduced in #3228 (6765e6d), shipped in curl 7.63.0. - - Fixes #4893 - Closes #5020 - Signed-off-by: Ernst Sjöstrand <ernst.sjostrand@verisure.com> - -- version: make curl_version* thread-safe without using global context - - Closes #5010 - -- RELEASE-NOTES: synced - -Marc Hoersken (7 Mar 2020) -- tests: use native Sleep function as fallback on Windows - - Reviewed-By: Daniel Stenberg - Closes #5054 - -- perl: align order and completeness of Windows OS checks - -Daniel Stenberg (7 Mar 2020) -- tool_cb_see: set correct copyright year range - - Follow-up to a39e5bfb9 - -Marc Hoersken (7 Mar 2020) -- seek: fix fallback for missing ftruncate on Windows - - This fixes test 198 on versions of MinGW-w64 without ftruncate - - Reviewed-By: Daniel Stenberg - Reviewed-By: Marcel Raad - Closes #5055 - -- config-win32: Windows does not have ftruncate - -Daniel Stenberg (7 Mar 2020) -- pause: force a connection (re-)check after unpausing - - There might be data available that was already read off the socket, for - example in the TLS layer. - - Reported-by: Anders Berg - Fixes #4966 - Closes #5049 - -- socks5: switch state properly when the resolve is done - - Regression from 4a4b63d (and #4907) - Reported-by: vitaha85 on github - Fixes #5053 - Closes #5056 - -Jay Satiro (7 Mar 2020) -- libssh: Fix matching user-specified MD5 hex key - - Prior to this change a match would never be successful because it - was mistakenly coded to compare binary data from libssh to a - user-specified hex string (ie CURLOPT_SSH_HOST_PUBLIC_KEY_MD5). - - Reported-by: fds242@users.noreply.github.com - - Fixes https://github.com/curl/curl/issues/4971 - Closes https://github.com/curl/curl/pull/4974 - -Daniel Stenberg (6 Mar 2020) -- pause: bail out on bad input - - A NULL easy handle or an easy handle without an associated connection - cannot be paused or unpaused. - - Closes #5050 - -Steve Holme (6 Mar 2020) -- unit1612: fixed the inclusion and compilation of the HMAC unit test - - Follow up to 3f74e5e6 to fix: - - - A typo in Makefile.inc where unit1611 was used instead - - Some compilation issues in unit1612.c - - Closes #5024 - -Daniel Stenberg (6 Mar 2020) -- pause: return early for calls that don't change pause state - - Reviewed-by: Patrick Monnerat - Ref: #4833 - Closes #5026 - -Jay Satiro (6 Mar 2020) -- curl_share_setopt.3: Note sharing cookies doesn't enable the engine - - Follow-up to d0a7ee3 which fixed a bug in 7.66.0 that caused - CURL_LOCK_DATA_COOKIE to enable the easy handle's cookie engine. - - Bug: https://curl.haxx.se/mail/lib-2020-03/0019.html - Reported-by: Felipe Gasper - - Closes https://github.com/curl/curl/pull/5048 - -- multi: skip EINTR check on wakeup socket if it was closed - - - Don't check errno on wakeup socket if sread returned 0 since sread - doesn't set errno in that case. - - This is a follow-up to cf7760a from several days ago which fixed - Curl_multi_wait to stop busy looping sread on the non-blocking wakeup - socket if it was closed (ie sread returns 0). Due to a logic error it - was still possible to busy loop in that case if errno == EINTR. - - Closes https://github.com/curl/curl/pull/5047 - -Daniel Stenberg (6 Mar 2020) -- transfer: set correct copyright year range - -- urldata: remove the 'stream_was_rewound' connectdata struct member - - ... as it is never set anywhere. - - Follow-up to 2f44e94ef - Closes #5046 - -- Revert "pause: force-drain the transfer on unpause" - - This reverts commit fa0216b294af4c7113a9040ca65eefc7fc18ac1c (from #5000) - - Clearly that didn't solve the problem correctly. - - Reported-by: Christopher Reid - Reopens #4966 - Fixes #5044 - -- RELEASE-NOTES: synced - - and bumped curlver.h - -- MANUAL: update a dict-using command line - - The 'web1913' database is now invalid, use 'gcide' instead. - -- KNOWN_BUGS: configure --with-gssapi with Heimdal is ignored on macOS - - Closes #3841 - -- polarssl: remove more references and mentions - - Assisted-by: Jay Satiro - Follow-up to 6357a19ff29dac04 - Closes #5036 - -Marc Hoersken (4 Mar 2020) -- tests: wrap ignored test failures in braces - -- tests: align some Windows sleep defines with each other - -- tests: try to make sleeping portable by avoiding select - - select does not support just waiting on Windows: - https://perldoc.perl.org/perlport.html#select - - Reviewed-By: Daniel Stenberg - Closes #5035 - -Daniel Stenberg (4 Mar 2020) -- runtests.1: rephrase how to specify what tests to run - - Also mention the new tilde-prefixed way to ignore test results. - - Reviewed-By: Marc Hoersken - Closes #5033 - -- cirrus-ci: disable the FreeBSD 13 builds - - FreeBSD 13.0 is apparently close to a year away from a stable release - and has proven to cause intermittent builds failures recently. - - Assisted-by: Dan Fandrich - Assisted-by: Fedor Korotkov - Fixes #5028 - Closes #5029 - -Version 7.69.0 (4 Mar 2020) - -Daniel Stenberg (4 Mar 2020) -- RELEASE-NOTES: 7.69.0 - -- THANKS: from 7.69.0 - - Now sorted case insensitive - -Marc Hoersken (3 Mar 2020) -- ci/tests: fix escaping of testnames and disable proxy for CI APIs - - Follow up to ada581f and c0d8b96 - Closes #5031 - -Jay Satiro (3 Mar 2020) -- cmake: Show HTTPS-proxy in the features output - - - Show HTTPS-proxy in the features output for those backends that - support it: OpenSSL, GnuTLS and NSS. - - Prior to this change HTTPS-proxy was missing from the cmake features - output even if curl was built with it. Only cmake output was affected. - Both the library and tool correctly reported the feature. - - Bug: https://curl.haxx.se/mail/lib-2020-03/0008.html - Reported-by: David Lopes - - Closes https://github.com/curl/curl/pull/5025 - -Marc Hoersken (3 Mar 2020) -- ci/tests: Make it possible to still run but ignore failing tests - - This enables the development of a solution for the failing tests by - running them on CI while ignoring their result for the overall status. - - Closes #4994 - -- README.md: add Azure DevOps Pipelines build status badge - -- ci/tests: Move CI test result creation above environment setup - - This avoids using our test servers as proxy to the AppVeyor API. - - Closes #5022 - -- ci/tests: Send test results to AppVeyor for status overview - - Closes #5021 - -Daniel Stenberg (3 Mar 2020) -- Revert "sha256: Added SecureTransport implementation" - - This reverts commit 4feb38deed33fed14ff7c370a6a9153c661dbb9c (from #4956) - - That commit broke test 1610 on macos builds without TLS. - - Closes #5027 - -- dist: include tests/azure.pm in the tarball - - Bug: https://github.com/curl/curl/commit/ada581f2cc32f48c1629b729707ac19208435b27#commitcomment-37601589 - Reported-by: Marcel Raad - -Steve Holme (3 Mar 2020) -- configure.ac: Disable metalink if mbedTLS is specified - - Follow up to cdcc9df1 and #5006. Even though I mentioned mbedTLS as - being one of the backends that metalink needs to be disabled for, I - seem to have included it in the list of allowed SSL/TLS backends in - comnfigure.ac :( - - Closes #5013 - -- sha256: Tidy up following recent changes - - Reviewed-by: Daniel Stenberg - Closes #4956 - -- sha256: Added WinCrypt implementation - -- sha256: Added SecureTransport implementation - -- sha256: Added mbedtls implementation - -- sha256: Added GNU TLS gcrypt implementation - -- sha256: Added GNU TLS Nettle implementation - -Jay Satiro (2 Mar 2020) -- curl_escape.3: Add a link to curl_free - - Ref: https://github.com/curl/curl/pull/5016#issuecomment-593628582 - -- curl_getenv.3: Fix the memory handling description - - - Tell the user to call curl_free() to free the pointer returned by - curl_getenv(). - - Prior to this change the user was directed to call free(), but that - would not work in cases where the library and application use separate C - runtimes and therefore have separate heap memory management. - - Closes https://github.com/curl/curl/pull/5016 - -Daniel Stenberg (2 Mar 2020) -- [Nick Zitzmann brought this change] - - md4: use init/update/final functions in Secure Transport - - We can use CC_MD4_Init/Update/Final without having to allocate memory - directly. - - Closes #4979 - -Marc Hoersken (2 Mar 2020) -- ci/tests: some MacOS builds randomly take longer than 20min - -Daniel Stenberg (2 Mar 2020) -- multi_wait: stop loop when sread() returns zero - - It's unclear why it would ever return zero here, but this change fixes - Robert's problem and it shouldn't loop forever... - - Reported-by: Robert Dunaj - Bug: https://curl.haxx.se/mail/archive-2020-02/0011.html - Closes #5019 - -- http: mark POSTs with no body as "upload done" from the start - - As we have logic that checks if we get a >= 400 reponse code back before - the upload is done, which then got confused since it wasn't "done" but - yet there was no data to send! - - Reported-by: IvanoG on github - Fixes #4996 - Closes #5002 - -- tests: disable 962, 963 and 964 on Windows - - These tests are also doing UTF-8 SMTP. - - Follow-up to df207d2dd93b9e73 - -Marc Hoersken (2 Mar 2020) -- ci/tests: fine-tune Azure Pipeline timeouts with a small puffer - -Daniel Stenberg (2 Mar 2020) -- configure: bump the AC_COPYRIGHT year range - -- [Steve Holme brought this change] - - tests: disable SMTP UTF-8 tests on Windows - - Fixes #4988 - Closes #4992 - -- formdata/mime: copyright year range update - - Due to the merge/revert cycle - -- Revert "mime: latch last read callback status." - - This reverts commit 87869e38d7afdec3ef1bb4965711458b088e254f. - - Fixes #5014 - Closes #5015 - Reopens #4833 - -- Revert "mime: do not perform more than one read in a row" - - This reverts commit ed0f357f7d25566110d4302f33759f4ffb5a6f83. - -- Revert "mime: fix the binary encoder to handle large data properly" - - This reverts commit b2caaa0681f329eed317ffb6ae6927f4a539f0c1. - -- altsvc: both h3 backends now speak h3-27 - - ... also updated the HTTP3 build description for ngtcp2 accordingly. - -- [Patrick Monnerat brought this change] - - mime: fix the binary encoder to handle large data properly - - New test 666 checks this is effective. - As upload buffer size is significant in this kind of tests, shorten it - in similar test 652. - - Fixes #4860 - Reported-by: RuurdBeerstra on github - -- [Patrick Monnerat brought this change] - - mime: do not perform more than one read in a row - - Input buffer filling may delay the data sending if data reads are slow. - To overcome this problem, file and callback data reads do not accumulate - in buffer anymore. All other data (memory data and mime framing) are - considered as fast and still concatenated in buffer. - As this may highly impact performance in terms of data overhead, an early - end of part data check is added to spare a read call. - When encoding a part's data, an encoder may require more bytes than made - available by a single read. In this case, the above rule does not apply - and reads are performed until the encoder is able to deliver some data. - - Tests 643, 644, 645, 650 and 654 have been adapted to the output data - changes, with test data size reduced to avoid the boredom of long lists of - 1-byte chunks in verification data. - New test 664 checks mimepost using single-byte read callback with encoder. - New test 665 checks the end of part data early detection. - - Fixes #4826 - Reported-by: MrdUkk on github - -- [Patrick Monnerat brought this change] - - mime: latch last read callback status. - - In case a read callback returns a status (pause, abort, eof, - error) instead of a byte count, drain the bytes read so far but - remember this status for further processing. - Takes care of not losing data when pausing, and properly resume a - paused mime structure when requested. - New tests 670-673 check unpausing cases, with easy or multi - interface and mime or form api. - - Fixes #4813 - Reported-by: MrdUkk on github - Closes #4833 - -Steve Holme (1 Mar 2020) -- unit1651: Fixed conversion compilation warning - - 371:17: warning: conversion to 'unsigned char' from 'int' may alter its - value [-Wconversion] - - Closes #5008 - -- configure.ac: Disable metalink support if an incompatible SSL/TLS specified - - tool_metalink only supports cryptography from OpenSSL, GnuTLS, NSS, - The Win32 Crypto library and Apple's Common Crypto library. - - If an TLS backend such as mbedTLS or WolfSSL is specified then the - following error is given during compilation along, with a load of - unresolved extern errors: - - Can't compile METALINK support without a crypto library. - - Reviewed-by: Daniel Stenberg - Closes #5006 - -Marc Hoersken (1 Mar 2020) -- ci/tests: Update Azure DevOps pipeline job display names - - Make the configure step more descriptive and align others. - -- ci/tests: Fix typo in previous commit 597cf2 - -- ci/tests: Make sure that the AZURE_ACCESS_TOKEN is available - - For security reasons the access token is not available to PR builds. - Therefore we should not try to use the DevOps API with an empty token. diff --git a/libs/libcurl/docs/THANKS b/libs/libcurl/docs/THANKS index 9e037eecf1..fcac1f5f30 100644 --- a/libs/libcurl/docs/THANKS +++ b/libs/libcurl/docs/THANKS @@ -116,6 +116,7 @@ Andre Heinecke Andreas Damm Andreas Falkenhahn Andreas Farber +Andreas Fischer Andreas Kostyrka Andreas Malzahn Andreas Ntaflos @@ -201,6 +202,7 @@ Austin Green Avery Fay Axel Tillequin Ayoub Boudhar +b9a1 on github Balaji Parasuram Balaji S Rao Balaji Salunke @@ -407,6 +409,7 @@ Craig Markwardt crazydef on github Cris Bailiff Cristian Greco +Cristian Morales Vega Cristian Rodríguez Curt Bogmine Cynthia Coan @@ -415,6 +418,7 @@ Cyrill Osterwalder Cédric Connes Cédric Deltheil D. Flinkmann +d4d on hackerone d912e3 on github Da-Yoon Chung daboul on github @@ -532,6 +536,7 @@ Dheeraj Sangamkar Didier Brisebourg Diego Bes Diego Casorran +Dietmar Hauser Dilyan Palauzov Dima Barsky Dima Pasechnik @@ -545,6 +550,7 @@ Dinar Dirk Eddelbuettel Dirk Feytons Dirk Manske +Dirk Wetter Dirkjan Bussink Diven Qi divinity76 on github @@ -620,6 +626,7 @@ Elliot Saba Ellis Pritchard Elmira A Semenova elsamuko on github +emanruse on github Emanuele Bovisio Emil Engler Emil Lerner @@ -883,6 +890,7 @@ Jack Zhang Jackarain on github Jacky Lam Jacob Barthelmeh +Jacob Hoffman-Andrews Jacob Meuser Jacob Moshenko Jactry Zeng @@ -1081,6 +1089,7 @@ Joshua Kwan Joshua Swink Josie Huddleston Josue Andrade Gomes +José Joaquín Atria Jozef Kralik JP Mens Juan Barreto @@ -1117,6 +1126,7 @@ Jörg Mueller-Tolk Jörn Hartroth K. R. Walker ka7 on github +Kael1117 on github Kai Engert Kai Noda Kai Sommerfeld @@ -1160,6 +1170,7 @@ Kimmo Kinnunen Kirill Marchuk Kjell Ericson Kjetil Jacobsen +Klaus Crusius Klaus Stein Klevtsov Vadim Kobi Gurkan @@ -1168,6 +1179,7 @@ Konstantin Isakov Konstantin Kushnir kotoriのねこ kouzhudong on github +Kovalkov Dmitrii kreshano on github Kris Kennaway Krishnendu Majumdar @@ -1547,6 +1559,7 @@ Nikos Tsipinakis niner on github Ning Dong Nir Soffer +Niranjan Hasabnis Nis Jorgensen nk NobodyXu on github @@ -1556,6 +1569,7 @@ nopjmp on github Norbert Frese Norbert Kett Norbert Novotny +nosajsnikta on github NTMan on Github Octavio Schroeder Ofer @@ -1571,6 +1585,7 @@ Oliver Gondža Oliver Graute Oliver Kuckertz Oliver Schindler +Oliver Urbann Olivier Berger Olivier Brunel Omar Ramadan @@ -1647,6 +1662,7 @@ pendrek at hackerone Peng Li Per Lundberg Per Malmberg +Per Nilsson Pete Lomax Peter Bray Peter Forret @@ -1687,6 +1703,7 @@ Philip Craig Philip Gladstone Philip Langdale Philip Prindeville +Philipp Klaus Krause Philipp Waehnert Philippe Hameau Philippe Marguinaud @@ -1853,6 +1870,7 @@ Rosimildo da Silva Ross Burton Roy Bellingan Roy Shan +Rui LIU Rune Kleveland Ruslan Baratov Ruslan Gazizov @@ -2053,6 +2071,7 @@ therealhirudo on github tholin on github Thomas Bouzerar Thomas Braun +Thomas Danielsson Thomas Gamper Thomas Glanzmann Thomas J. Moore @@ -2107,6 +2126,7 @@ Todd Short Todd Vierling Tom Benoist Tom Donovan +Tom G. Christensen Tom Grace Tom Greenslade Tom Lee @@ -2164,6 +2184,7 @@ Valentin David Valentyn Korniienko Valerii Zapodovnikov vanillajonathan on github +Varnavas Papaioannou Vasiliy Faronov Vasily Lobaskin Vasy Okhin @@ -2231,6 +2252,7 @@ Xiang Xiao Xiangbin Li Xiaoyin Liu XmiliaH on github +xnynx on github xwxbug on github Yaakov Selkowitz Yang Tse diff --git a/libs/libcurl/include/curl/curl.h b/libs/libcurl/include/curl/curl.h index 9026aa5c16..a73418dcea 100644 --- a/libs/libcurl/include/curl/curl.h +++ b/libs/libcurl/include/curl/curl.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -24,7 +24,7 @@ /* * If you have libcurl problems, all docs and details are found here: - * https://curl.haxx.se/libcurl/ + * https://curl.se/libcurl/ * * curl-library mailing list subscription and unsubscription web interface: * https://cool.haxx.se/mailman/listinfo/curl-library/ @@ -74,7 +74,7 @@ #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \ - defined(__CYGWIN__) || \ + defined(__CYGWIN__) || defined(AMIGA) || \ (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) #include <sys/select.h> #endif @@ -949,13 +949,42 @@ typedef enum { #define CURLHEADER_SEPARATE (1<<0) /* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */ -#define CURLALTSVC_IMMEDIATELY (1<<0) - #define CURLALTSVC_READONLYFILE (1<<2) #define CURLALTSVC_H1 (1<<3) #define CURLALTSVC_H2 (1<<4) #define CURLALTSVC_H3 (1<<5) + +struct curl_hstsentry { + char *name; + size_t namelen; + unsigned int includeSubDomains:1; + char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */ +}; + +struct curl_index { + size_t index; /* the provided entry's "index" or count */ + size_t total; /* total number of entries to save */ +}; + +typedef enum { + CURLSTS_OK, + CURLSTS_DONE, + CURLSTS_FAIL +} CURLSTScode; + +typedef CURLSTScode (*curl_hstsread_callback)(CURL *easy, + struct curl_hstsentry *e, + void *userp); +typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy, + struct curl_hstsentry *e, + struct curl_index *i, + void *userp); + +/* CURLHSTS_* are bits for the CURLOPT_HSTS option */ +#define CURLHSTS_ENABLE (long)(1<<0) +#define CURLHSTS_READONLYFILE (long)(1<<1) + /* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */ #define CURLPROTO_HTTP (1<<0) #define CURLPROTO_HTTPS (1<<1) @@ -2031,6 +2060,19 @@ typedef enum { */ CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298), + /* HSTS bitmask */ + CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299), + /* HSTS file name */ + CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300), + + /* HSTS read callback */ + CURLOPT(CURLOPT_HSTSREADFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 301), + CURLOPT(CURLOPT_HSTSREADDATA, CURLOPTTYPE_CBPOINT, 302), + + /* HSTS write callback */ + CURLOPT(CURLOPT_HSTSWRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 303), + CURLOPT(CURLOPT_HSTSWRITEDATA, CURLOPTTYPE_CBPOINT, 304), + CURLOPT_LASTENTRY /* the last unused */ } CURLoption; @@ -2902,6 +2944,7 @@ typedef struct curl_version_info_data curl_version_info_data; #define CURL_VERSION_HTTP3 (1<<25) /* HTTP3 support built-in */ #define CURL_VERSION_ZSTD (1<<26) /* zstd features are present */ #define CURL_VERSION_UNICODE (1<<27) /* Unicode support on Windows */ +#define CURL_VERSION_HSTS (1<<28) /* HSTS is supported */ /* * NAME curl_version_info() diff --git a/libs/libcurl/include/curl/curlver.h b/libs/libcurl/include/curl/curlver.h index 2c3010e195..0acb5a8cbf 100644 --- a/libs/libcurl/include/curl/curlver.h +++ b/libs/libcurl/include/curl/curlver.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -30,12 +30,12 @@ /* This is the version number of the libcurl package from which this header file origins: */ -#define LIBCURL_VERSION "7.73.0" +#define LIBCURL_VERSION "7.74.0" /* The numeric version number is also available "in parts" by using these defines: */ #define LIBCURL_VERSION_MAJOR 7 -#define LIBCURL_VERSION_MINOR 73 +#define LIBCURL_VERSION_MINOR 74 #define LIBCURL_VERSION_PATCH 0 /* This is the numeric version of the libcurl version number, meant for easier @@ -57,7 +57,7 @@ CURL_VERSION_BITS() macro since curl's own configure script greps for it and needs it to contain the full number. */ -#define LIBCURL_VERSION_NUM 0x074900 +#define LIBCURL_VERSION_NUM 0x074a00 /* * This is the date and time when the full source package was created. The @@ -68,7 +68,7 @@ * * "2007-11-23" */ -#define LIBCURL_TIMESTAMP "2020-10-14" +#define LIBCURL_TIMESTAMP "2020-12-09" #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z)) #define CURL_AT_LEAST_VERSION(x,y,z) \ diff --git a/libs/libcurl/include/curl/easy.h b/libs/libcurl/include/curl/easy.h index 9aef133962..2dbfb26b5b 100644 --- a/libs/libcurl/include/curl/easy.h +++ b/libs/libcurl/include/curl/easy.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/include/curl/mprintf.h b/libs/libcurl/include/curl/mprintf.h index f615ed7d63..3549552dba 100644 --- a/libs/libcurl/include/curl/mprintf.h +++ b/libs/libcurl/include/curl/mprintf.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/include/curl/multi.h b/libs/libcurl/include/curl/multi.h index b911ba92dd..37f9829b3b 100644 --- a/libs/libcurl/include/curl/multi.h +++ b/libs/libcurl/include/curl/multi.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/include/curl/options.h b/libs/libcurl/include/curl/options.h index f3bd8e191d..14373b551c 100644 --- a/libs/libcurl/include/curl/options.h +++ b/libs/libcurl/include/curl/options.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/include/curl/stdcheaders.h b/libs/libcurl/include/curl/stdcheaders.h index a6bdc1a25c..60596c7568 100644 --- a/libs/libcurl/include/curl/stdcheaders.h +++ b/libs/libcurl/include/curl/stdcheaders.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/include/curl/system.h b/libs/libcurl/include/curl/system.h index 867af61418..faf8fcf84f 100644 --- a/libs/libcurl/include/curl/system.h +++ b/libs/libcurl/include/curl/system.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/include/curl/typecheck-gcc.h b/libs/libcurl/include/curl/typecheck-gcc.h index 318ab0abb3..6d84150dc2 100644 --- a/libs/libcurl/include/curl/typecheck-gcc.h +++ b/libs/libcurl/include/curl/typecheck-gcc.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -273,6 +273,7 @@ CURLWARNING(_curl_easy_getinfo_err_curl_off_t, (option) == CURLOPT_FTPPORT || \ (option) == CURLOPT_FTP_ACCOUNT || \ (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \ + (option) == CURLOPT_HSTS || \ (option) == CURLOPT_INTERFACE || \ (option) == CURLOPT_ISSUERCERT || \ (option) == CURLOPT_KEYPASSWD || \ @@ -356,6 +357,8 @@ CURLWARNING(_curl_easy_getinfo_err_curl_off_t, (option) == CURLOPT_DEBUGDATA || \ (option) == CURLOPT_FNMATCH_DATA || \ (option) == CURLOPT_HEADERDATA || \ + (option) == CURLOPT_HSTSREADDATA || \ + (option) == CURLOPT_HSTSWRITEDATA || \ (option) == CURLOPT_INTERLEAVEDATA || \ (option) == CURLOPT_IOCTLDATA || \ (option) == CURLOPT_OPENSOCKETDATA || \ diff --git a/libs/libcurl/include/curl/urlapi.h b/libs/libcurl/include/curl/urlapi.h index f2d06770dc..7343cb659e 100644 --- a/libs/libcurl/include/curl/urlapi.h +++ b/libs/libcurl/include/curl/urlapi.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2018 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2018 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/libcurl.vcxproj b/libs/libcurl/libcurl.vcxproj index fca047ec2d..13e026a676 100644 --- a/libs/libcurl/libcurl.vcxproj +++ b/libs/libcurl/libcurl.vcxproj @@ -179,6 +179,9 @@ <ClCompile Include="src\hostsyn.c">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
+ <ClCompile Include="src\hsts.c">
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ </ClCompile>
<ClCompile Include="src\http.c">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
@@ -494,6 +497,7 @@ <ClInclude Include="src\hash.h" />
<ClInclude Include="src\hostcheck.h" />
<ClInclude Include="src\hostip.h" />
+ <ClInclude Include="src\hsts.h" />
<ClInclude Include="src\http.h" />
<ClInclude Include="src\http2.h" />
<ClInclude Include="src\http_chunks.h" />
diff --git a/libs/libcurl/libcurl.vcxproj.filters b/libs/libcurl/libcurl.vcxproj.filters index 1b7c14dc7b..7c975c65db 100644 --- a/libs/libcurl/libcurl.vcxproj.filters +++ b/libs/libcurl/libcurl.vcxproj.filters @@ -152,6 +152,9 @@ <ClCompile Include="src\hostsyn.c">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\hsts.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
<ClCompile Include="src\http.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -637,6 +640,9 @@ <ClInclude Include="src\hostip.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="src\hsts.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
<ClInclude Include="src\http.h">
<Filter>Header Files</Filter>
</ClInclude>
diff --git a/libs/libcurl/src/CMakeLists.txt b/libs/libcurl/src/CMakeLists.txt index 911c9096dd..9736e39e52 100644 --- a/libs/libcurl/src/CMakeLists.txt +++ b/libs/libcurl/src/CMakeLists.txt @@ -9,7 +9,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -39,7 +39,7 @@ list(APPEND HHEADERS ${CMAKE_CURRENT_BINARY_DIR}/curl_config.h ) -if(MSVC) +if(WIN32) list(APPEND CSOURCES libcurl.rc) endif() @@ -88,10 +88,6 @@ add_library( ALIAS ${LIB_NAME} ) -if(MSVC AND NOT BUILD_SHARED_LIBS) - set_target_properties(${LIB_NAME} PROPERTIES STATIC_LIBRARY_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) -endif() - if(NOT BUILD_SHARED_LIBS) set_target_properties(${LIB_NAME} PROPERTIES INTERFACE_COMPILE_DEFINITIONS CURL_STATICLIB) endif() diff --git a/libs/libcurl/src/Makefile.am b/libs/libcurl/src/Makefile.am index 78b068ffe1..b51796f91e 100644 --- a/libs/libcurl/src/Makefile.am +++ b/libs/libcurl/src/Makefile.am @@ -9,7 +9,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/Makefile.in b/libs/libcurl/src/Makefile.in index ca348fbaf5..ce7fe0d34f 100644 --- a/libs/libcurl/src/Makefile.in +++ b/libs/libcurl/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.16.2 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. @@ -25,7 +25,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -229,7 +229,8 @@ am__objects_1 = libcurl_la-altsvc.lo libcurl_la-amigaos.lo \ libcurl_la-version.lo libcurl_la-warnless.lo \ libcurl_la-wildcard.lo libcurl_la-x509asn1.lo \ libcurl_la-dynbuf.lo libcurl_la-version_win32.lo \ - libcurl_la-easyoptions.lo libcurl_la-easygetopt.lo + libcurl_la-easyoptions.lo libcurl_la-easygetopt.lo \ + libcurl_la-hsts.lo am__dirstamp = $(am__leading_dot)dirstamp am__objects_2 = vauth/libcurl_la-cleartext.lo vauth/libcurl_la-cram.lo \ vauth/libcurl_la-digest.lo vauth/libcurl_la-digest_sspi.lo \ @@ -319,7 +320,8 @@ am__objects_9 = libcurlu_la-altsvc.lo libcurlu_la-amigaos.lo \ libcurlu_la-version.lo libcurlu_la-warnless.lo \ libcurlu_la-wildcard.lo libcurlu_la-x509asn1.lo \ libcurlu_la-dynbuf.lo libcurlu_la-version_win32.lo \ - libcurlu_la-easyoptions.lo libcurlu_la-easygetopt.lo + libcurlu_la-easyoptions.lo libcurlu_la-easygetopt.lo \ + libcurlu_la-hsts.lo am__objects_10 = vauth/libcurlu_la-cleartext.lo \ vauth/libcurlu_la-cram.lo vauth/libcurlu_la-digest.lo \ vauth/libcurlu_la-digest_sspi.lo \ @@ -414,6 +416,7 @@ am__depfiles_remade = ./$(DEPDIR)/libcurl_la-altsvc.Plo \ ./$(DEPDIR)/libcurl_la-hostip4.Plo \ ./$(DEPDIR)/libcurl_la-hostip6.Plo \ ./$(DEPDIR)/libcurl_la-hostsyn.Plo \ + ./$(DEPDIR)/libcurl_la-hsts.Plo \ ./$(DEPDIR)/libcurl_la-http.Plo \ ./$(DEPDIR)/libcurl_la-http2.Plo \ ./$(DEPDIR)/libcurl_la-http_chunks.Plo \ @@ -527,6 +530,7 @@ am__depfiles_remade = ./$(DEPDIR)/libcurl_la-altsvc.Plo \ ./$(DEPDIR)/libcurlu_la-hostip4.Plo \ ./$(DEPDIR)/libcurlu_la-hostip6.Plo \ ./$(DEPDIR)/libcurlu_la-hostsyn.Plo \ + ./$(DEPDIR)/libcurlu_la-hsts.Plo \ ./$(DEPDIR)/libcurlu_la-http.Plo \ ./$(DEPDIR)/libcurlu_la-http2.Plo \ ./$(DEPDIR)/libcurlu_la-http_chunks.Plo \ @@ -931,7 +935,7 @@ top_srcdir = @top_srcdir@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -1029,7 +1033,7 @@ LIB_CFILES = altsvc.c amigaos.c asyn-ares.c asyn-thread.c base64.c \ socks_gssapi.c socks_sspi.c speedcheck.c splay.c strcase.c strdup.c \ strerror.c strtok.c strtoofft.c system_win32.c telnet.c tftp.c timeval.c \ transfer.c urlapi.c version.c warnless.c wildcard.c x509asn1.c dynbuf.c \ - version_win32.c easyoptions.c easygetopt.c + version_win32.c easyoptions.c easygetopt.c hsts.c LIB_HFILES = altsvc.h amigaos.h arpa_telnet.h asyn.h conncache.h connect.h \ content_encoding.h cookie.h curl_addrinfo.h curl_base64.h curl_ctype.h \ @@ -1048,7 +1052,7 @@ LIB_HFILES = altsvc.h amigaos.h arpa_telnet.h asyn.h conncache.h connect.h \ smb.h smtp.h sockaddr.h socketpair.h socks.h speedcheck.h splay.h strcase.h \ strdup.h strerror.h strtok.h strtoofft.h system_win32.h telnet.h tftp.h \ timeval.h transfer.h urlapi-int.h urldata.h warnless.h wildcard.h \ - x509asn1.h dynbuf.h version_win32.h easyoptions.h + x509asn1.h dynbuf.h version_win32.h easyoptions.h hsts.h LIB_RCFILES = libcurl.rc CSOURCES = $(LIB_CFILES) $(LIB_VAUTH_CFILES) $(LIB_VTLS_CFILES) \ @@ -1391,6 +1395,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hostip4.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hostip6.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hostsyn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-hsts.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-http.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-http2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurl_la-http_chunks.Plo@am__quote@ # am--include-marker @@ -1507,6 +1512,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hostip4.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hostip6.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hostsyn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-hsts.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-http.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-http2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcurlu_la-http_chunks.Plo@am__quote@ # am--include-marker @@ -2479,6 +2485,13 @@ libcurl_la-easygetopt.lo: easygetopt.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-easygetopt.lo `test -f 'easygetopt.c' || echo '$(srcdir)/'`easygetopt.c +libcurl_la-hsts.lo: hsts.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT libcurl_la-hsts.lo -MD -MP -MF $(DEPDIR)/libcurl_la-hsts.Tpo -c -o libcurl_la-hsts.lo `test -f 'hsts.c' || echo '$(srcdir)/'`hsts.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurl_la-hsts.Tpo $(DEPDIR)/libcurl_la-hsts.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hsts.c' object='libcurl_la-hsts.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -c -o libcurl_la-hsts.lo `test -f 'hsts.c' || echo '$(srcdir)/'`hsts.c + vauth/libcurl_la-cleartext.lo: vauth/cleartext.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurl_la_CPPFLAGS) $(CPPFLAGS) $(libcurl_la_CFLAGS) $(CFLAGS) -MT vauth/libcurl_la-cleartext.lo -MD -MP -MF vauth/$(DEPDIR)/libcurl_la-cleartext.Tpo -c -o vauth/libcurl_la-cleartext.lo `test -f 'vauth/cleartext.c' || echo '$(srcdir)/'`vauth/cleartext.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vauth/$(DEPDIR)/libcurl_la-cleartext.Tpo vauth/$(DEPDIR)/libcurl_la-cleartext.Plo @@ -3515,6 +3528,13 @@ libcurlu_la-easygetopt.lo: easygetopt.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-easygetopt.lo `test -f 'easygetopt.c' || echo '$(srcdir)/'`easygetopt.c +libcurlu_la-hsts.lo: hsts.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT libcurlu_la-hsts.lo -MD -MP -MF $(DEPDIR)/libcurlu_la-hsts.Tpo -c -o libcurlu_la-hsts.lo `test -f 'hsts.c' || echo '$(srcdir)/'`hsts.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcurlu_la-hsts.Tpo $(DEPDIR)/libcurlu_la-hsts.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hsts.c' object='libcurlu_la-hsts.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -c -o libcurlu_la-hsts.lo `test -f 'hsts.c' || echo '$(srcdir)/'`hsts.c + vauth/libcurlu_la-cleartext.lo: vauth/cleartext.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcurlu_la_CPPFLAGS) $(CPPFLAGS) $(libcurlu_la_CFLAGS) $(CFLAGS) -MT vauth/libcurlu_la-cleartext.lo -MD -MP -MF vauth/$(DEPDIR)/libcurlu_la-cleartext.Tpo -c -o vauth/libcurlu_la-cleartext.lo `test -f 'vauth/cleartext.c' || echo '$(srcdir)/'`vauth/cleartext.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) vauth/$(DEPDIR)/libcurlu_la-cleartext.Tpo vauth/$(DEPDIR)/libcurlu_la-cleartext.Plo @@ -3937,6 +3957,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/libcurl_la-hostip4.Plo -rm -f ./$(DEPDIR)/libcurl_la-hostip6.Plo -rm -f ./$(DEPDIR)/libcurl_la-hostsyn.Plo + -rm -f ./$(DEPDIR)/libcurl_la-hsts.Plo -rm -f ./$(DEPDIR)/libcurl_la-http.Plo -rm -f ./$(DEPDIR)/libcurl_la-http2.Plo -rm -f ./$(DEPDIR)/libcurl_la-http_chunks.Plo @@ -4053,6 +4074,7 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/libcurlu_la-hostip4.Plo -rm -f ./$(DEPDIR)/libcurlu_la-hostip6.Plo -rm -f ./$(DEPDIR)/libcurlu_la-hostsyn.Plo + -rm -f ./$(DEPDIR)/libcurlu_la-hsts.Plo -rm -f ./$(DEPDIR)/libcurlu_la-http.Plo -rm -f ./$(DEPDIR)/libcurlu_la-http2.Plo -rm -f ./$(DEPDIR)/libcurlu_la-http_chunks.Plo @@ -4278,6 +4300,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcurl_la-hostip4.Plo -rm -f ./$(DEPDIR)/libcurl_la-hostip6.Plo -rm -f ./$(DEPDIR)/libcurl_la-hostsyn.Plo + -rm -f ./$(DEPDIR)/libcurl_la-hsts.Plo -rm -f ./$(DEPDIR)/libcurl_la-http.Plo -rm -f ./$(DEPDIR)/libcurl_la-http2.Plo -rm -f ./$(DEPDIR)/libcurl_la-http_chunks.Plo @@ -4394,6 +4417,7 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcurlu_la-hostip4.Plo -rm -f ./$(DEPDIR)/libcurlu_la-hostip6.Plo -rm -f ./$(DEPDIR)/libcurlu_la-hostsyn.Plo + -rm -f ./$(DEPDIR)/libcurlu_la-hsts.Plo -rm -f ./$(DEPDIR)/libcurlu_la-http.Plo -rm -f ./$(DEPDIR)/libcurlu_la-http2.Plo -rm -f ./$(DEPDIR)/libcurlu_la-http_chunks.Plo diff --git a/libs/libcurl/src/Makefile.inc b/libs/libcurl/src/Makefile.inc index a2fd57a831..6d35704c02 100644 --- a/libs/libcurl/src/Makefile.inc +++ b/libs/libcurl/src/Makefile.inc @@ -9,7 +9,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -61,7 +61,7 @@ LIB_CFILES = altsvc.c amigaos.c asyn-ares.c asyn-thread.c base64.c \ socks_gssapi.c socks_sspi.c speedcheck.c splay.c strcase.c strdup.c \ strerror.c strtok.c strtoofft.c system_win32.c telnet.c tftp.c timeval.c \ transfer.c urlapi.c version.c warnless.c wildcard.c x509asn1.c dynbuf.c \ - version_win32.c easyoptions.c easygetopt.c + version_win32.c easyoptions.c easygetopt.c hsts.c LIB_HFILES = altsvc.h amigaos.h arpa_telnet.h asyn.h conncache.h connect.h \ content_encoding.h cookie.h curl_addrinfo.h curl_base64.h curl_ctype.h \ @@ -80,7 +80,7 @@ LIB_HFILES = altsvc.h amigaos.h arpa_telnet.h asyn.h conncache.h connect.h \ smb.h smtp.h sockaddr.h socketpair.h socks.h speedcheck.h splay.h strcase.h \ strdup.h strerror.h strtok.h strtoofft.h system_win32.h telnet.h tftp.h \ timeval.h transfer.h urlapi-int.h urldata.h warnless.h wildcard.h \ - x509asn1.h dynbuf.h version_win32.h easyoptions.h + x509asn1.h dynbuf.h version_win32.h easyoptions.h hsts.h LIB_RCFILES = libcurl.rc diff --git a/libs/libcurl/src/Makefile.m32 b/libs/libcurl/src/Makefile.m32 index 37887eed5d..d23eeead3b 100644 --- a/libs/libcurl/src/Makefile.m32 +++ b/libs/libcurl/src/Makefile.m32 @@ -9,7 +9,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -77,6 +77,14 @@ endif ifndef NGHTTP2_PATH NGHTTP2_PATH = ../../nghttp2-1.0.0 endif +# Edit the path below to point to the base of your nghttp3 package. +ifndef NGHTTP3_PATH +NGHTTP3_PATH = ../../nghttp3-1.0.0 +endif +# Edit the path below to point to the base of your ngtcp2 package. +ifndef NGTCP2_PATH +NGTCP2_PATH = ../../ngtcp2-1.0.0 +endif PROOT = .. @@ -212,6 +220,15 @@ endif ifeq ($(findstring -nghttp2,$(CFG)),-nghttp2) NGHTTP2 = 1 endif +ifeq ($(findstring -nghttp3,$(CFG)),-nghttp3) +NGHTTP3 = 1 +endif +ifeq ($(findstring -ngtcp2,$(CFG)),-ngtcp2) +NGTCP2 = 1 +endif +ifeq ($(findstring -unicode,$(CFG)),-unicode) +UNICODE = 1 +endif INCLUDES = -I. -I../include CFLAGS += -DBUILDING_LIBCURL @@ -220,6 +237,9 @@ ifdef SSL CFLAGS += -DCURL_WITH_MULTI_SSL endif endif +ifdef UNICODE + CFLAGS += -DUNICODE -D_UNICODE +endif ifdef SYNC CFLAGS += -DUSE_SYNC_DNS @@ -252,6 +272,17 @@ ifdef SSH2 endif endif ifdef SSL + ifdef NGHTTP3 + INCLUDES += -I"$(NGHTTP3_PATH)/include" + CFLAGS += -DUSE_NGHTTP3 + DLL_LIBS += -L"$(NGHTTP3_PATH)/lib" -lnghttp3 + ifdef NGTCP2 + INCLUDES += -I"$(NGTCP2_PATH)/include" + CFLAGS += -DUSE_NGTCP2 + DLL_LIBS += -L"$(NGTCP2_PATH)/lib" -lngtcp2 -lngtcp2_crypto_openssl + endif + endif + ifndef OPENSSL_INCLUDE ifeq "$(wildcard $(OPENSSL_PATH)/outinc)" "$(OPENSSL_PATH)/outinc" OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc diff --git a/libs/libcurl/src/Makefile.netware b/libs/libcurl/src/Makefile.netware index 2c16adbac9..10b77f8ffb 100644 --- a/libs/libcurl/src/Makefile.netware +++ b/libs/libcurl/src/Makefile.netware @@ -10,7 +10,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -82,7 +82,7 @@ endif TARGET = libcurl VERSION = $(LIBCURL_VERSION) COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR) -DESCR = curl libcurl $(LIBCURL_VERSION_STR) ($(LIBARCH)) - https://curl.haxx.se +DESCR = curl libcurl $(LIBCURL_VERSION_STR) ($(LIBARCH)) - https://curl.se MTSAFE = YES STACK = 64000 SCREEN = none @@ -481,7 +481,7 @@ curl_config.h: Makefile.netware @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@ @echo $(DL)#endif$(DL) >> $@ @echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@ - @echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.haxx.se/mail/"$(DL) >> $@ + @echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.se/mail/"$(DL) >> $@ ifeq ($(LIBARCH),CLIB) @echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@ @echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@ diff --git a/libs/libcurl/src/Makefile.vxworks b/libs/libcurl/src/Makefile.vxworks index ada87fbd3c..91f9d61497 100644 --- a/libs/libcurl/src/Makefile.vxworks +++ b/libs/libcurl/src/Makefile.vxworks @@ -9,7 +9,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/altsvc.c b/libs/libcurl/src/altsvc.c index d3deba3e83..4ab77fdfc8 100644 --- a/libs/libcurl/src/altsvc.c +++ b/libs/libcurl/src/altsvc.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -25,7 +25,7 @@ */ #include "curl_setup.h" -#if !defined(CURL_DISABLE_HTTP) && defined(USE_ALTSVC) +#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_ALTSVC) #include <curl/curl.h> #include "urldata.h" #include "altsvc.h" @@ -355,7 +355,7 @@ CURLcode Curl_altsvc_save(struct Curl_easy *data, if(!out) result = CURLE_WRITE_ERROR; else { - fputs("# Your alt-svc cache. https://curl.haxx.se/docs/alt-svc.html\n" + fputs("# Your alt-svc cache. https://curl.se/docs/alt-svc.html\n" "# This file was generated by libcurl! Edit at your own risk.\n", out); for(e = altsvc->list.head; e; e = n) { @@ -451,12 +451,14 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, { const char *p = value; size_t len; - enum alpnid dstalpnid = srcalpnid; /* the same by default */ char namebuf[MAX_ALTSVC_HOSTLEN] = ""; char alpnbuf[MAX_ALTSVC_ALPNLEN] = ""; struct altsvc *as; unsigned short dstport = srcport; /* the same by default */ CURLcode result = getalnum(&p, alpnbuf, sizeof(alpnbuf)); +#ifdef CURL_DISABLE_VERBOSE_STRINGS + (void)data; +#endif if(result) { infof(data, "Excessive alt-svc header, ignoring...\n"); return CURLE_OK; @@ -475,7 +477,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, do { if(*p == '=') { /* [protocol]="[host][:port]" */ - dstalpnid = alpn2alpnid(alpnbuf); + enum alpnid dstalpnid = alpn2alpnid(alpnbuf); /* the same by default */ p++; if(*p == '\"') { const char *dsthost = ""; @@ -642,4 +644,4 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi, return FALSE; } -#endif /* CURL_DISABLE_HTTP || USE_ALTSVC */ +#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_ALTSVC */ diff --git a/libs/libcurl/src/altsvc.h b/libs/libcurl/src/altsvc.h index 1aeb625ab4..2ab89e7059 100644 --- a/libs/libcurl/src/altsvc.h +++ b/libs/libcurl/src/altsvc.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -23,7 +23,7 @@ ***************************************************************************/ #include "curl_setup.h" -#if !defined(CURL_DISABLE_HTTP) && defined(USE_ALTSVC) +#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_ALTSVC) #include <curl/curl.h> #include "llist.h" @@ -75,5 +75,5 @@ bool Curl_altsvc_lookup(struct altsvcinfo *asi, /* disabled */ #define Curl_altsvc_save(a,b,c) #define Curl_altsvc_cleanup(x) -#endif /* CURL_DISABLE_HTTP || USE_ALTSVC */ +#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_ALTSVC */ #endif /* HEADER_CURL_ALTSVC_H */ diff --git a/libs/libcurl/src/amigaos.c b/libs/libcurl/src/amigaos.c index cf44bdc8d1..d3b00d9083 100644 --- a/libs/libcurl/src/amigaos.c +++ b/libs/libcurl/src/amigaos.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/amigaos.h b/libs/libcurl/src/amigaos.h index c776c9c9bb..02e5bb546a 100644 --- a/libs/libcurl/src/amigaos.h +++ b/libs/libcurl/src/amigaos.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/arpa_telnet.h b/libs/libcurl/src/arpa_telnet.h index 232680e7d6..cbe31de5a3 100644 --- a/libs/libcurl/src/arpa_telnet.h +++ b/libs/libcurl/src/arpa_telnet.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/asyn-ares.c b/libs/libcurl/src/asyn-ares.c index 725d6cd5c8..1747571889 100644 --- a/libs/libcurl/src/asyn-ares.c +++ b/libs/libcurl/src/asyn-ares.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -85,7 +85,7 @@ #include "curl_memory.h" #include "memdebug.h" -struct ResolverResults { +struct thread_data { int num_pending; /* number of ares_gethostbyname() requests */ struct Curl_addrinfo *temp_ai; /* intermediary result while fetching c-ares parts */ @@ -229,8 +229,8 @@ static void destroy_async_data(struct Curl_async *async) { free(async->hostname); - if(async->os_specific) { - struct ResolverResults *res = (struct ResolverResults *)async->os_specific; + if(async->tdata) { + struct thread_data *res = async->tdata; if(res) { if(res->temp_ai) { Curl_freeaddrinfo(res->temp_ai); @@ -238,7 +238,7 @@ static void destroy_async_data(struct Curl_async *async) } free(res); } - async->os_specific = NULL; + async->tdata = NULL; } async->hostname = NULL; @@ -349,8 +349,7 @@ CURLcode Curl_resolver_is_resolved(struct connectdata *conn, struct Curl_dns_entry **dns) { struct Curl_easy *data = conn->data; - struct ResolverResults *res = (struct ResolverResults *) - conn->async.os_specific; + struct thread_data *res = conn->async.tdata; CURLcode result = CURLE_OK; DEBUGASSERT(dns); @@ -498,7 +497,7 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn, } /* Connects results to the list */ -static void compound_results(struct ResolverResults *res, +static void compound_results(struct thread_data *res, struct Curl_addrinfo *ai) { struct Curl_addrinfo *ai_tail; @@ -527,7 +526,7 @@ static void query_completed_cb(void *arg, /* (struct connectdata *) */ struct hostent *hostent) { struct connectdata *conn = (struct connectdata *)arg; - struct ResolverResults *res; + struct thread_data *res; #ifdef HAVE_CARES_CALLBACK_TIMEOUTS (void)timeouts; /* ignored */ @@ -538,7 +537,7 @@ static void query_completed_cb(void *arg, /* (struct connectdata *) */ be valid so only defer it when we know the 'status' says its fine! */ return; - res = (struct ResolverResults *)conn->async.os_specific; + res = conn->async.tdata; if(res) { res->num_pending--; @@ -653,20 +652,20 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn, bufp = strdup(hostname); if(bufp) { - struct ResolverResults *res = NULL; + struct thread_data *res = NULL; free(conn->async.hostname); conn->async.hostname = bufp; conn->async.port = port; conn->async.done = FALSE; /* not done */ conn->async.status = 0; /* clear */ conn->async.dns = NULL; /* clear */ - res = calloc(sizeof(struct ResolverResults), 1); + res = calloc(sizeof(struct thread_data), 1); if(!res) { free(conn->async.hostname); conn->async.hostname = NULL; return NULL; } - conn->async.os_specific = res; + conn->async.tdata = res; /* initial status - failed */ res->last_status = ARES_ENOTFOUND; diff --git a/libs/libcurl/src/asyn-thread.c b/libs/libcurl/src/asyn-thread.c index a60f4f0661..7c85982748 100644 --- a/libs/libcurl/src/asyn-thread.c +++ b/libs/libcurl/src/asyn-thread.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -185,7 +185,7 @@ struct thread_data { static struct thread_sync_data *conn_thread_sync_data(struct connectdata *conn) { - return &(((struct thread_data *)conn->async.os_specific)->tsd); + return &(conn->async.tdata->tsd); } /* Destroy resolver thread synchronization data */ @@ -294,7 +294,7 @@ static int getaddrinfo_complete(struct connectdata *conn) */ static unsigned int CURL_STDCALL getaddrinfo_thread(void *arg) { - struct thread_sync_data *tsd = (struct thread_sync_data*)arg; + struct thread_sync_data *tsd = (struct thread_sync_data *)arg; struct thread_data *td = tsd->td; char service[12]; int rc; @@ -380,8 +380,8 @@ static unsigned int CURL_STDCALL gethostbyname_thread(void *arg) */ static void destroy_async_data(struct Curl_async *async) { - if(async->os_specific) { - struct thread_data *td = (struct thread_data*) async->os_specific; + if(async->tdata) { + struct thread_data *td = async->tdata; int done; #ifdef USE_SOCKETPAIR curl_socket_t sock_rd = td->tsd.sock_pair[0]; @@ -406,7 +406,7 @@ static void destroy_async_data(struct Curl_async *async) destroy_thread_sync_data(&td->tsd); - free(async->os_specific); + free(async->tdata); } #ifdef USE_SOCKETPAIR /* @@ -418,7 +418,7 @@ static void destroy_async_data(struct Curl_async *async) sclose(sock_rd); #endif } - async->os_specific = NULL; + async->tdata = NULL; free(async->hostname); async->hostname = NULL; @@ -437,7 +437,7 @@ static bool init_resolve_thread(struct connectdata *conn, struct thread_data *td = calloc(1, sizeof(struct thread_data)); int err = ENOMEM; - conn->async.os_specific = (void *)td; + conn->async.tdata = td; if(!td) goto errno_exit; @@ -448,7 +448,7 @@ static bool init_resolve_thread(struct connectdata *conn, td->thread_hnd = curl_thread_t_null; if(!init_thread_sync_data(td, hostname, port, hints)) { - conn->async.os_specific = NULL; + conn->async.tdata = NULL; free(td); goto errno_exit; } @@ -519,7 +519,7 @@ static CURLcode thread_wait_resolv(struct connectdata *conn, struct Curl_dns_entry **entry, bool report) { - struct thread_data *td = (struct thread_data*) conn->async.os_specific; + struct thread_data *td = conn->async.tdata; CURLcode result = CURLE_OK; DEBUGASSERT(conn && td); @@ -557,7 +557,7 @@ static CURLcode thread_wait_resolv(struct connectdata *conn, */ void Curl_resolver_kill(struct connectdata *conn) { - struct thread_data *td = (struct thread_data*) conn->async.os_specific; + struct thread_data *td = conn->async.tdata; /* If we're still resolving, we must wait for the threads to fully clean up, unfortunately. Otherwise, we can simply cancel to clean up any resolver @@ -596,7 +596,7 @@ CURLcode Curl_resolver_is_resolved(struct connectdata *conn, struct Curl_dns_entry **entry) { struct Curl_easy *data = conn->data; - struct thread_data *td = (struct thread_data*) conn->async.os_specific; + struct thread_data *td = conn->async.tdata; int done = 0; DEBUGASSERT(entry); @@ -656,7 +656,7 @@ int Curl_resolver_getsock(struct connectdata *conn, struct Curl_easy *data = conn->data; struct resdata *reslv = (struct resdata *)data->state.resolver; #ifdef USE_SOCKETPAIR - struct thread_data *td = (struct thread_data*)conn->async.os_specific; + struct thread_data *td = conn->async.tdata; #else (void)socks; #endif diff --git a/libs/libcurl/src/asyn.h b/libs/libcurl/src/asyn.h index bd3c3c1230..73a9b7268f 100644 --- a/libs/libcurl/src/asyn.h +++ b/libs/libcurl/src/asyn.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/base64.c b/libs/libcurl/src/base64.c index ec632e6f7a..be6f163dc4 100644 --- a/libs/libcurl/src/base64.c +++ b/libs/libcurl/src/base64.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/checksrc.pl b/libs/libcurl/src/checksrc.pl index 78b9cef5bd..13f86ecd5a 100644 --- a/libs/libcurl/src/checksrc.pl +++ b/libs/libcurl/src/checksrc.pl @@ -10,7 +10,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is @@ -85,6 +85,7 @@ my %warnings = ( 'DOBRACE' => 'A single space between do and open brace', 'BRACEWHILE' => 'A single space between open brace and while', 'EXCLAMATIONSPACE' => 'Whitespace after exclamation mark in expression', + 'EMPTYLINEBRACE' => 'Empty line before the open brace', ); sub readskiplist { @@ -594,6 +595,11 @@ sub scanfile { checkwarn("PARENBRACE", $line, length($1)+1, $file, $l, "missing space after close paren"); } + # check for "^{" with an empty line before it + if(($l =~ /^\{/) && ($prevl =~ /^[ \t]*\z/)) { + checkwarn("EMPTYLINEBRACE", + $line, 0, $file, $l, "empty line before open brace"); + } # check for space before the semicolon last in a line if($l =~ /^(.*[^ ].*) ;$/) { diff --git a/libs/libcurl/src/config-amigaos.h b/libs/libcurl/src/config-amigaos.h index 12a87cf298..3c9d76ef3d 100644 --- a/libs/libcurl/src/config-amigaos.h +++ b/libs/libcurl/src/config-amigaos.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -96,7 +96,7 @@ #define OS "AmigaOS" #define PACKAGE "curl" -#define PACKAGE_BUGREPORT "a suitable mailing list: https://curl.haxx.se/mail/" +#define PACKAGE_BUGREPORT "a suitable mailing list: https://curl.se/mail/" #define PACKAGE_NAME "curl" #define PACKAGE_STRING "curl -" #define PACKAGE_TARNAME "curl" diff --git a/libs/libcurl/src/config-dos.h b/libs/libcurl/src/config-dos.h index 349e756395..50816ac756 100644 --- a/libs/libcurl/src/config-dos.h +++ b/libs/libcurl/src/config-dos.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/config-mac.h b/libs/libcurl/src/config-mac.h index 14b98fe572..4e610562f6 100644 --- a/libs/libcurl/src/config-mac.h +++ b/libs/libcurl/src/config-mac.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/config-os400.h b/libs/libcurl/src/config-os400.h index 7beb81fafd..b8676113d7 100644 --- a/libs/libcurl/src/config-os400.h +++ b/libs/libcurl/src/config-os400.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -422,9 +422,6 @@ /* Define if you can safely include both <sys/time.h> and <time.h>. */ #define TIME_WITH_SYS_TIME -/* Define to enable alt-svc support (experimental) */ -#undef USE_ALTSVC - /* Define to enable HTTP3 support (experimental, requires NGTCP2 or QUICHE) */ #undef ENABLE_QUIC diff --git a/libs/libcurl/src/config-plan9.h b/libs/libcurl/src/config-plan9.h index 41440a14ec..cc8adde725 100644 --- a/libs/libcurl/src/config-plan9.h +++ b/libs/libcurl/src/config-plan9.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -33,7 +33,7 @@ #define OS "plan9" #define PACKAGE "curl" #define PACKAGE_NAME "curl" -#define PACKAGE_BUGREPORT "a suitable mailing list: https://curl.haxx.se/mail/" +#define PACKAGE_BUGREPORT "a suitable mailing list: https://curl.se/mail/" #define PACKAGE_STRING "curl -" #define PACKAGE_TARNAME "curl" #define PACKAGE_VERSION "-" diff --git a/libs/libcurl/src/config-riscos.h b/libs/libcurl/src/config-riscos.h index 0ddf487e89..9b5f8da921 100644 --- a/libs/libcurl/src/config-riscos.h +++ b/libs/libcurl/src/config-riscos.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/config-tpf.h b/libs/libcurl/src/config-tpf.h index 199dfbcd58..bf69179fd5 100644 --- a/libs/libcurl/src/config-tpf.h +++ b/libs/libcurl/src/config-tpf.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -561,7 +561,7 @@ /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT \ - "a suitable curl mailing list => https://curl.haxx.se/mail/" + "a suitable curl mailing list => https://curl.se/mail/" /* Define to the full name of this package. */ #define PACKAGE_NAME "curl" diff --git a/libs/libcurl/src/config-vxworks.h b/libs/libcurl/src/config-vxworks.h index 14bf0be464..73edd530b4 100644 --- a/libs/libcurl/src/config-vxworks.h +++ b/libs/libcurl/src/config-vxworks.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/config-win32.h b/libs/libcurl/src/config-win32.h index 7ac33c51fe..e3095576f8 100644 --- a/libs/libcurl/src/config-win32.h +++ b/libs/libcurl/src/config-win32.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -246,10 +246,6 @@ /* Define if you have the socket function. */ #define HAVE_SOCKET 1 -/* Define if libSSH2 is in use */ -#define USE_LIBSSH2 1 -#define HAVE_LIBSSH2_H 1 - /* Define if you have the strcasecmp function. */ /* #define HAVE_STRCASECMP 1 */ @@ -717,9 +713,6 @@ Vista # define CURL_DISABLE_LDAP 1 #endif -/* if SSL is enabled */ -#define USE_OPENSSL 1 - /* Define to use the Windows crypto library. */ #if !defined(CURL_WINDOWS_APP) #define USE_WIN32_CRYPTO diff --git a/libs/libcurl/src/config-win32ce.h b/libs/libcurl/src/config-win32ce.h index 5eb1c18f6f..9060836944 100644 --- a/libs/libcurl/src/config-win32ce.h +++ b/libs/libcurl/src/config-win32ce.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/conncache.c b/libs/libcurl/src/conncache.c index c0e4d3e30f..cb3170c480 100644 --- a/libs/libcurl/src/conncache.c +++ b/libs/libcurl/src/conncache.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/conncache.h b/libs/libcurl/src/conncache.h index c3e9ff51b9..ac5460ff4b 100644 --- a/libs/libcurl/src/conncache.h +++ b/libs/libcurl/src/conncache.h @@ -12,7 +12,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/connect.c b/libs/libcurl/src/connect.c index 5f23b79ca0..e65d24d9e9 100644 --- a/libs/libcurl/src/connect.c +++ b/libs/libcurl/src/connect.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -673,57 +673,69 @@ bool Curl_addr2string(struct sockaddr *sa, curl_socklen_t salen, /* retrieves the start/end point information of a socket of an established connection */ -void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd) +void Curl_conninfo_remote(struct connectdata *conn, curl_socket_t sockfd) { - if(conn->transport == TRNSPRT_TCP) { -#if defined(HAVE_GETPEERNAME) || defined(HAVE_GETSOCKNAME) - if(!conn->bits.reuse && !conn->bits.tcp_fastopen) { - struct Curl_easy *data = conn->data; - char buffer[STRERROR_LEN]; - struct Curl_sockaddr_storage ssrem; - struct Curl_sockaddr_storage ssloc; - curl_socklen_t plen; - curl_socklen_t slen; #ifdef HAVE_GETPEERNAME - plen = sizeof(struct Curl_sockaddr_storage); - if(getpeername(sockfd, (struct sockaddr*) &ssrem, &plen)) { - int error = SOCKERRNO; - failf(data, "getpeername() failed with errno %d: %s", - error, Curl_strerror(error, buffer, sizeof(buffer))); - return; - } -#endif -#ifdef HAVE_GETSOCKNAME - slen = sizeof(struct Curl_sockaddr_storage); - memset(&ssloc, 0, sizeof(ssloc)); - if(getsockname(sockfd, (struct sockaddr*) &ssloc, &slen)) { - int error = SOCKERRNO; - failf(data, "getsockname() failed with errno %d: %s", - error, Curl_strerror(error, buffer, sizeof(buffer))); - return; - } -#endif -#ifdef HAVE_GETPEERNAME - if(!Curl_addr2string((struct sockaddr*)&ssrem, plen, - conn->primary_ip, &conn->primary_port)) { - failf(data, "ssrem inet_ntop() failed with errno %d: %s", - errno, Curl_strerror(errno, buffer, sizeof(buffer))); - return; - } - memcpy(conn->ip_addr_str, conn->primary_ip, MAX_IPADR_LEN); + char buffer[STRERROR_LEN]; + struct Curl_sockaddr_storage ssrem; + curl_socklen_t plen; + plen = sizeof(struct Curl_sockaddr_storage); + if(getpeername(sockfd, (struct sockaddr*) &ssrem, &plen)) { + int error = SOCKERRNO; + failf(conn->data, "getpeername() failed with errno %d: %s", + error, Curl_strerror(error, buffer, sizeof(buffer))); + return; + } + if(!Curl_addr2string((struct sockaddr*)&ssrem, plen, + conn->primary_ip, &conn->primary_port)) { + failf(conn->data, "ssrem inet_ntop() failed with errno %d: %s", + errno, Curl_strerror(errno, buffer, sizeof(buffer))); + return; + } + memcpy(conn->ip_addr_str, conn->primary_ip, MAX_IPADR_LEN); +#else + (void)conn; + (void)sockfd; #endif +} + +/* retrieves the start/end point information of a socket of an established + connection */ +void Curl_conninfo_local(struct connectdata *conn, curl_socket_t sockfd) +{ #ifdef HAVE_GETSOCKNAME - if(!Curl_addr2string((struct sockaddr*)&ssloc, slen, - conn->local_ip, &conn->local_port)) { - failf(data, "ssloc inet_ntop() failed with errno %d: %s", - errno, Curl_strerror(errno, buffer, sizeof(buffer))); - return; - } + char buffer[STRERROR_LEN]; + struct Curl_sockaddr_storage ssloc; + curl_socklen_t slen; + slen = sizeof(struct Curl_sockaddr_storage); + memset(&ssloc, 0, sizeof(ssloc)); + if(getsockname(sockfd, (struct sockaddr*) &ssloc, &slen)) { + int error = SOCKERRNO; + failf(conn->data, "getsockname() failed with errno %d: %s", + error, Curl_strerror(error, buffer, sizeof(buffer))); + return; + } + if(!Curl_addr2string((struct sockaddr*)&ssloc, slen, + conn->local_ip, &conn->local_port)) { + failf(conn->data, "ssloc inet_ntop() failed with errno %d: %s", + errno, Curl_strerror(errno, buffer, sizeof(buffer))); + return; + } +#else + (void)conn; + (void)sockfd; #endif +} + +/* retrieves the start/end point information of a socket of an established + connection */ +void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd) +{ + if(conn->transport == TRNSPRT_TCP) { + if(!conn->bits.reuse && !conn->bits.tcp_fastopen) { + Curl_conninfo_remote(conn, sockfd); + Curl_conninfo_local(conn, sockfd); } -#else /* !HAVE_GETSOCKNAME && !HAVE_GETPEERNAME */ - (void)sockfd; /* unused */ -#endif } /* end of TCP-only section */ /* persist connection info in session handle */ @@ -1334,8 +1346,12 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */ conn->tempfamily[0] = conn->tempaddr[0]? conn->tempaddr[0]->ai_family:0; +#ifdef ENABLE_IPV6 conn->tempfamily[1] = conn->tempfamily[0] == AF_INET6 ? AF_INET : AF_INET6; +#else + conn->tempfamily[1] = AF_UNSPEC; +#endif ainext(conn, 1, FALSE); /* assigns conn->tempaddr[1] accordingly */ DEBUGF(infof(data, "family0 == %s, family1 == %s\n", diff --git a/libs/libcurl/src/connect.h b/libs/libcurl/src/connect.h index 6fd9ea8789..9b1faf8fb7 100644 --- a/libs/libcurl/src/connect.h +++ b/libs/libcurl/src/connect.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -75,6 +75,8 @@ void Curl_sndbufset(curl_socket_t sockfd); #endif void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd); +void Curl_conninfo_remote(struct connectdata *conn, curl_socket_t sockfd); +void Curl_conninfo_local(struct connectdata *conn, curl_socket_t sockfd); void Curl_persistconninfo(struct connectdata *conn); int Curl_closesocket(struct connectdata *conn, curl_socket_t sock); diff --git a/libs/libcurl/src/content_encoding.c b/libs/libcurl/src/content_encoding.c index a6dce48804..82fcc2b83f 100644 --- a/libs/libcurl/src/content_encoding.c +++ b/libs/libcurl/src/content_encoding.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/content_encoding.h b/libs/libcurl/src/content_encoding.h index bdd3f1c8c6..70310875a0 100644 --- a/libs/libcurl/src/content_encoding.h +++ b/libs/libcurl/src/content_encoding.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/cookie.c b/libs/libcurl/src/cookie.c index cb7d94b102..e88678c219 100644 --- a/libs/libcurl/src/cookie.c +++ b/libs/libcurl/src/cookie.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -1539,7 +1539,7 @@ static int cookie_output(struct Curl_easy *data, } fputs("# Netscape HTTP Cookie File\n" - "# https://curl.haxx.se/docs/http-cookies.html\n" + "# https://curl.se/docs/http-cookies.html\n" "# This file was generated by libcurl! Edit at your own risk.\n\n", out); diff --git a/libs/libcurl/src/cookie.h b/libs/libcurl/src/cookie.h index b3865e601a..066396f0d5 100644 --- a/libs/libcurl/src/cookie.h +++ b/libs/libcurl/src/cookie.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_addrinfo.c b/libs/libcurl/src/curl_addrinfo.c index 947d0d3756..872395b05a 100644 --- a/libs/libcurl/src/curl_addrinfo.c +++ b/libs/libcurl/src/curl_addrinfo.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_addrinfo.h b/libs/libcurl/src/curl_addrinfo.h index a0cade614e..73a8c1b334 100644 --- a/libs/libcurl/src/curl_addrinfo.h +++ b/libs/libcurl/src/curl_addrinfo.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_base64.h b/libs/libcurl/src/curl_base64.h index cfb6ee75b2..d48edc4241 100644 --- a/libs/libcurl/src/curl_base64.h +++ b/libs/libcurl/src/curl_base64.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_config.h.cmake b/libs/libcurl/src/curl_config.h.cmake index eca3734b0c..082d76b371 100644 --- a/libs/libcurl/src/curl_config.h.cmake +++ b/libs/libcurl/src/curl_config.h.cmake @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -395,8 +395,11 @@ /* Define to 1 if you have the <libgen.h> header file. */ #cmakedefine HAVE_LIBGEN_H 1 -/* Define to 1 if you have the `idn' library (-lidn). */ -#cmakedefine HAVE_LIBIDN 1 +/* Define to 1 if you have the `idn2' library (-lidn2). */ +#cmakedefine HAVE_LIBIDN2 1 + +/* Define to 1 if you have the idn2.h header file. */ +#cmakedefine HAVE_IDN2_H 1 /* Define to 1 if you have the `resolv' library (-lresolv). */ #cmakedefine HAVE_LIBRESOLV 1 @@ -470,6 +473,9 @@ /* Define to 1 if you have the <netinet/tcp.h> header file. */ #cmakedefine HAVE_NETINET_TCP_H 1 +/* Define to 1 if you have the <linux/tcp.h> header file. */ +#cmakedefine HAVE_LINUX_TCP_H 1 + /* Define to 1 if you have the <net/if.h> header file. */ #cmakedefine HAVE_NET_IF_H 1 @@ -1014,8 +1020,8 @@ ${SIZEOF_TIME_T_CODE} /* if Unix domain sockets are enabled */ #cmakedefine USE_UNIX_SOCKETS -/* to enable alt-svc */ -#cmakedefine USE_ALTSVC 1 +/* to disable alt-svc */ +#cmakedefine CURL_DISABLE_ALTSVC 1 /* Define to 1 if you are building a Windows target with large file support. */ #cmakedefine USE_WIN32_LARGE_FILES 1 diff --git a/libs/libcurl/src/curl_config.h.in b/libs/libcurl/src/curl_config.h.in index ab8651a511..bd22a5e82a 100644 --- a/libs/libcurl/src/curl_config.h.in +++ b/libs/libcurl/src/curl_config.h.in @@ -15,6 +15,9 @@ /* Default SSL backend */ #undef CURL_DEFAULT_SSL_BACKEND +/* disable alt-svc */ +#undef CURL_DISABLE_ALTSVC + /* to disable cookies support */ #undef CURL_DISABLE_COOKIES @@ -972,9 +975,6 @@ /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ #undef TIME_WITH_SYS_TIME -/* to enable alt-svc */ -#undef USE_ALTSVC - /* if AmiSSL is in use */ #undef USE_AMISSL @@ -993,6 +993,9 @@ /* if GnuTLS uses nettle as crypto backend */ #undef USE_GNUTLS_NETTLE +/* to enable HSTS */ +#undef USE_HSTS + /* PSL support enabled */ #undef USE_LIBPSL diff --git a/libs/libcurl/src/curl_ctype.c b/libs/libcurl/src/curl_ctype.c index 1a47fb5e68..d6cd08a077 100644 --- a/libs/libcurl/src/curl_ctype.c +++ b/libs/libcurl/src/curl_ctype.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_ctype.h b/libs/libcurl/src/curl_ctype.h index 6e94bb1b43..17dfaa0942 100644 --- a/libs/libcurl/src/curl_ctype.h +++ b/libs/libcurl/src/curl_ctype.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_des.c b/libs/libcurl/src/curl_des.c index 39c0f35ee6..8c5af19cd2 100644 --- a/libs/libcurl/src/curl_des.c +++ b/libs/libcurl/src/curl_des.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2015 - 2019, Steve Holme, <steve_holme@hotmail.com>. + * Copyright (C) 2015 - 2020, Steve Holme, <steve_holme@hotmail.com>. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_des.h b/libs/libcurl/src/curl_des.h index a42eeb53f3..438706a0d2 100644 --- a/libs/libcurl/src/curl_des.h +++ b/libs/libcurl/src/curl_des.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2015 - 2019, Steve Holme, <steve_holme@hotmail.com>. + * Copyright (C) 2015 - 2020, Steve Holme, <steve_holme@hotmail.com>. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_endian.c b/libs/libcurl/src/curl_endian.c index a774d136e4..2fc25bc173 100644 --- a/libs/libcurl/src/curl_endian.c +++ b/libs/libcurl/src/curl_endian.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_endian.h b/libs/libcurl/src/curl_endian.h index 9830e58fd7..341dfaf3cc 100644 --- a/libs/libcurl/src/curl_endian.h +++ b/libs/libcurl/src/curl_endian.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_fnmatch.c b/libs/libcurl/src/curl_fnmatch.c index ab3e7428d7..4bfa58598e 100644 --- a/libs/libcurl/src/curl_fnmatch.c +++ b/libs/libcurl/src/curl_fnmatch.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_fnmatch.h b/libs/libcurl/src/curl_fnmatch.h index 34fccae488..1c80ea7793 100644 --- a/libs/libcurl/src/curl_fnmatch.h +++ b/libs/libcurl/src/curl_fnmatch.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_get_line.c b/libs/libcurl/src/curl_get_line.c index 3c77be9a95..438ede7046 100644 --- a/libs/libcurl/src/curl_get_line.c +++ b/libs/libcurl/src/curl_get_line.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -22,7 +22,8 @@ #include "curl_setup.h" -#if !defined(CURL_DISABLE_COOKIES) && !defined(CURL_DISABLE_ALTSVC) +#if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC) || \ + defined(USE_HSTS) #include "curl_get_line.h" #include "curl_memory.h" diff --git a/libs/libcurl/src/curl_get_line.h b/libs/libcurl/src/curl_get_line.h index 532ab080a2..597aa09a9c 100644 --- a/libs/libcurl/src/curl_get_line.h +++ b/libs/libcurl/src/curl_get_line.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_gethostname.c b/libs/libcurl/src/curl_gethostname.c index 5f1c9998fe..2d5ff61cf6 100644 --- a/libs/libcurl/src/curl_gethostname.c +++ b/libs/libcurl/src/curl_gethostname.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_gethostname.h b/libs/libcurl/src/curl_gethostname.h index 2d78bc54db..2161c40ac3 100644 --- a/libs/libcurl/src/curl_gethostname.h +++ b/libs/libcurl/src/curl_gethostname.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_gssapi.c b/libs/libcurl/src/curl_gssapi.c index d854ab0c7f..f72430b26f 100644 --- a/libs/libcurl/src/curl_gssapi.c +++ b/libs/libcurl/src/curl_gssapi.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2011 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2011 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_gssapi.h b/libs/libcurl/src/curl_gssapi.h index 88f68dbbbe..466d09ed0a 100644 --- a/libs/libcurl/src/curl_gssapi.h +++ b/libs/libcurl/src/curl_gssapi.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2011 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2011 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_hmac.h b/libs/libcurl/src/curl_hmac.h index 9b70c8468b..84c73121bd 100644 --- a/libs/libcurl/src/curl_hmac.h +++ b/libs/libcurl/src/curl_hmac.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_krb5.h b/libs/libcurl/src/curl_krb5.h index ae9b7e0d3e..f0a6fa69be 100644 --- a/libs/libcurl/src/curl_krb5.h +++ b/libs/libcurl/src/curl_krb5.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_ldap.h b/libs/libcurl/src/curl_ldap.h index 912e13107c..124e18b133 100644 --- a/libs/libcurl/src/curl_ldap.h +++ b/libs/libcurl/src/curl_ldap.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_md4.h b/libs/libcurl/src/curl_md4.h index c7bb209815..f9dafcb53c 100644 --- a/libs/libcurl/src/curl_md4.h +++ b/libs/libcurl/src/curl_md4.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_md5.h b/libs/libcurl/src/curl_md5.h index e06c68edfc..5739c89ca4 100644 --- a/libs/libcurl/src/curl_md5.h +++ b/libs/libcurl/src/curl_md5.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_memory.h b/libs/libcurl/src/curl_memory.h index ce38a08cd3..5806290637 100644 --- a/libs/libcurl/src/curl_memory.h +++ b/libs/libcurl/src/curl_memory.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_memrchr.c b/libs/libcurl/src/curl_memrchr.c index eeb3044a90..0bd845f690 100644 --- a/libs/libcurl/src/curl_memrchr.c +++ b/libs/libcurl/src/curl_memrchr.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_memrchr.h b/libs/libcurl/src/curl_memrchr.h index 90a8a07cce..c8394bb433 100644 --- a/libs/libcurl/src/curl_memrchr.h +++ b/libs/libcurl/src/curl_memrchr.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_multibyte.c b/libs/libcurl/src/curl_multibyte.c index 2c8925b531..d327c8ba77 100644 --- a/libs/libcurl/src/curl_multibyte.c +++ b/libs/libcurl/src/curl_multibyte.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_multibyte.h b/libs/libcurl/src/curl_multibyte.h index 5f8c05afcc..8adaf49784 100644 --- a/libs/libcurl/src/curl_multibyte.h +++ b/libs/libcurl/src/curl_multibyte.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_ntlm_core.c b/libs/libcurl/src/curl_ntlm_core.c index defae772b4..9a075ac90f 100644 --- a/libs/libcurl/src/curl_ntlm_core.c +++ b/libs/libcurl/src/curl_ntlm_core.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -580,15 +580,11 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen, unsigned char *identity; CURLcode result = CURLE_OK; - /* we do the length checks below separately to avoid integer overflow risk - on extreme data lengths */ - if((userlen > SIZE_T_MAX/2) || - (domlen > SIZE_T_MAX/2) || - ((userlen + domlen) > SIZE_T_MAX/2)) + if((userlen > CURL_MAX_INPUT_LENGTH) || (domlen > CURL_MAX_INPUT_LENGTH)) return CURLE_OUT_OF_MEMORY; identity_len = (userlen + domlen) * 2; - identity = malloc(identity_len); + identity = malloc(identity_len + 1); if(!identity) return CURLE_OUT_OF_MEMORY; diff --git a/libs/libcurl/src/curl_ntlm_core.h b/libs/libcurl/src/curl_ntlm_core.h index 6d391c4cb6..fab628c590 100644 --- a/libs/libcurl/src/curl_ntlm_core.h +++ b/libs/libcurl/src/curl_ntlm_core.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_ntlm_wb.c b/libs/libcurl/src/curl_ntlm_wb.c index 17a92f8ca2..c11757f557 100644 --- a/libs/libcurl/src/curl_ntlm_wb.c +++ b/libs/libcurl/src/curl_ntlm_wb.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_ntlm_wb.h b/libs/libcurl/src/curl_ntlm_wb.h index 3cf841cf24..4f847d22ca 100644 --- a/libs/libcurl/src/curl_ntlm_wb.h +++ b/libs/libcurl/src/curl_ntlm_wb.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_path.c b/libs/libcurl/src/curl_path.c index 7b3fb27ab1..8c8cbc2468 100644 --- a/libs/libcurl/src/curl_path.c +++ b/libs/libcurl/src/curl_path.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_path.h b/libs/libcurl/src/curl_path.h index 636c37f204..b601b48dfc 100644 --- a/libs/libcurl/src/curl_path.h +++ b/libs/libcurl/src/curl_path.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_printf.h b/libs/libcurl/src/curl_printf.h index 9d2de7ba8c..9fa625f108 100644 --- a/libs/libcurl/src/curl_printf.h +++ b/libs/libcurl/src/curl_printf.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_range.c b/libs/libcurl/src/curl_range.c index aa3c493321..0a87b1ca52 100644 --- a/libs/libcurl/src/curl_range.c +++ b/libs/libcurl/src/curl_range.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_range.h b/libs/libcurl/src/curl_range.h index 2350df9929..d1f2c6d55f 100644 --- a/libs/libcurl/src/curl_range.h +++ b/libs/libcurl/src/curl_range.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_rtmp.c b/libs/libcurl/src/curl_rtmp.c index 32f11130a0..ba471a2a19 100644 --- a/libs/libcurl/src/curl_rtmp.c +++ b/libs/libcurl/src/curl_rtmp.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_rtmp.h b/libs/libcurl/src/curl_rtmp.h index 86a01382da..f45fa71d12 100644 --- a/libs/libcurl/src/curl_rtmp.h +++ b/libs/libcurl/src/curl_rtmp.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2010 - 2019, Howard Chu, <hyc@highlandsun.com> + * Copyright (C) 2010 - 2020, Howard Chu, <hyc@highlandsun.com> * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_sasl.c b/libs/libcurl/src/curl_sasl.c index 83fe896e35..94b17a1d86 100644 --- a/libs/libcurl/src/curl_sasl.c +++ b/libs/libcurl/src/curl_sasl.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_sasl.h b/libs/libcurl/src/curl_sasl.h index 7647a48be4..ba40ec461a 100644 --- a/libs/libcurl/src/curl_sasl.h +++ b/libs/libcurl/src/curl_sasl.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2012 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2012 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_setup.h b/libs/libcurl/src/curl_setup.h index 3872dbb655..22def2defa 100644 --- a/libs/libcurl/src/curl_setup.h +++ b/libs/libcurl/src/curl_setup.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -238,7 +238,7 @@ * interface doesn't support IPv4, but supports IPv6, NAT64, and DNS64, * performing this task will result in a synthesized IPv6 address. */ -#ifdef __APPLE__ +#if defined(__APPLE__) && !defined(USE_ARES) #define USE_RESOLVE_ON_IPS 1 #endif @@ -277,10 +277,16 @@ # include <exec/execbase.h> # include <proto/exec.h> # include <proto/dos.h> +# include <unistd.h> # ifdef HAVE_PROTO_BSDSOCKET_H # include <proto/bsdsocket.h> /* ensure bsdsocket.library use */ # define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0) # endif +/* + * In clib2 arpa/inet.h warns that some prototypes may clash + * with bsdsocket.library. This avoids the definition of those. + */ +# define __NO_NET_API #endif #include <stdio.h> diff --git a/libs/libcurl/src/curl_setup_once.h b/libs/libcurl/src/curl_setup_once.h index e7c00deabd..ef60bc7ae7 100644 --- a/libs/libcurl/src/curl_setup_once.h +++ b/libs/libcurl/src/curl_setup_once.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_sha256.h b/libs/libcurl/src/curl_sha256.h index 35d286cebd..0fceb6329a 100644 --- a/libs/libcurl/src/curl_sha256.h +++ b/libs/libcurl/src/curl_sha256.h @@ -12,7 +12,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_sspi.c b/libs/libcurl/src/curl_sspi.c index 512ce24113..06841ddec6 100644 --- a/libs/libcurl/src/curl_sspi.c +++ b/libs/libcurl/src/curl_sspi.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_sspi.h b/libs/libcurl/src/curl_sspi.h index c09026ebbb..881384d4e4 100644 --- a/libs/libcurl/src/curl_sspi.h +++ b/libs/libcurl/src/curl_sspi.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_threads.c b/libs/libcurl/src/curl_threads.c index 6f3815e711..414614401d 100644 --- a/libs/libcurl/src/curl_threads.c +++ b/libs/libcurl/src/curl_threads.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curl_threads.h b/libs/libcurl/src/curl_threads.h index 65d1a790c1..e10b7a1b0e 100644 --- a/libs/libcurl/src/curl_threads.h +++ b/libs/libcurl/src/curl_threads.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/curlx.h b/libs/libcurl/src/curlx.h index 98e51bf566..9f21f60d5f 100644 --- a/libs/libcurl/src/curlx.h +++ b/libs/libcurl/src/curlx.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/dict.c b/libs/libcurl/src/dict.c index 8dd4a90f7f..15d3954aa3 100644 --- a/libs/libcurl/src/dict.c +++ b/libs/libcurl/src/dict.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -156,8 +156,7 @@ static CURLcode sendf(curl_socket_t sockfd, struct connectdata *conn, if(result) break; - if(data->set.verbose) - Curl_debug(data, CURLINFO_DATA_OUT, sptr, (size_t)bytes_written); + Curl_debug(data, CURLINFO_DATA_OUT, sptr, (size_t)bytes_written); if((size_t)bytes_written != write_len) { /* if not all was written at once, we must advance the pointer, decrease diff --git a/libs/libcurl/src/dict.h b/libs/libcurl/src/dict.h index 38a55ac0de..6a6c772d13 100644 --- a/libs/libcurl/src/dict.h +++ b/libs/libcurl/src/dict.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/doh.c b/libs/libcurl/src/doh.c index e8b0801109..c2b76de53a 100644 --- a/libs/libcurl/src/doh.c +++ b/libs/libcurl/src/doh.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/doh.h b/libs/libcurl/src/doh.h index bbd4c1a65e..0867584ced 100644 --- a/libs/libcurl/src/doh.h +++ b/libs/libcurl/src/doh.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/dotdot.c b/libs/libcurl/src/dotdot.c index ce9a052143..3a1435f8ec 100644 --- a/libs/libcurl/src/dotdot.c +++ b/libs/libcurl/src/dotdot.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/dotdot.h b/libs/libcurl/src/dotdot.h index f70b1db3fe..ac1ea363e1 100644 --- a/libs/libcurl/src/dotdot.h +++ b/libs/libcurl/src/dotdot.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/dynbuf.c b/libs/libcurl/src/dynbuf.c index b2465b8886..ada7e0ccf5 100644 --- a/libs/libcurl/src/dynbuf.c +++ b/libs/libcurl/src/dynbuf.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/dynbuf.h b/libs/libcurl/src/dynbuf.h index 39b8595706..484e40c645 100644 --- a/libs/libcurl/src/dynbuf.h +++ b/libs/libcurl/src/dynbuf.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/easy.c b/libs/libcurl/src/easy.c index 60e2befd76..dc790b01df 100644 --- a/libs/libcurl/src/easy.c +++ b/libs/libcurl/src/easy.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -79,6 +79,7 @@ #include "http2.h" #include "dynbuf.h" #include "altsvc.h" +#include "hsts.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" @@ -881,6 +882,17 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data) (void)Curl_altsvc_load(outcurl->asi, outcurl->set.str[STRING_ALTSVC]); } #endif +#ifdef USE_HSTS + if(data->hsts) { + outcurl->hsts = Curl_hsts_init(); + if(!outcurl->hsts) + goto fail; + if(outcurl->set.str[STRING_HSTS]) + (void)Curl_hsts_loadfile(outcurl, + outcurl->hsts, outcurl->set.str[STRING_HSTS]); + (void)Curl_hsts_loadcb(outcurl, outcurl->hsts); + } +#endif /* Clone the resolver handle, if present, for the new handle */ if(Curl_resolver_duphandle(outcurl, &outcurl->state.resolver, @@ -929,6 +941,7 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data) Curl_safefree(outcurl->change.url); Curl_safefree(outcurl->change.referer); Curl_altsvc_cleanup(&outcurl->asi); + Curl_hsts_cleanup(&outcurl->hsts); Curl_freeset(outcurl); free(outcurl); } diff --git a/libs/libcurl/src/easygetopt.c b/libs/libcurl/src/easygetopt.c index cac8378e7e..7b2213fb24 100644 --- a/libs/libcurl/src/easygetopt.c +++ b/libs/libcurl/src/easygetopt.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/easyif.h b/libs/libcurl/src/easyif.h index eda0d62e5f..3364418285 100644 --- a/libs/libcurl/src/easyif.h +++ b/libs/libcurl/src/easyif.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/easyoptions.c b/libs/libcurl/src/easyoptions.c index 0ab6a3fc6d..f236da23ab 100644 --- a/libs/libcurl/src/easyoptions.c +++ b/libs/libcurl/src/easyoptions.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -115,6 +115,12 @@ struct curl_easyoption Curl_easyopts[] = { {"HEADERDATA", CURLOPT_HEADERDATA, CURLOT_CBPTR, 0}, {"HEADERFUNCTION", CURLOPT_HEADERFUNCTION, CURLOT_FUNCTION, 0}, {"HEADEROPT", CURLOPT_HEADEROPT, CURLOT_VALUES, 0}, + {"HSTS", CURLOPT_HSTS, CURLOT_STRING, 0}, + {"HSTSREADDATA", CURLOPT_HSTSREADDATA, CURLOT_CBPTR, 0}, + {"HSTSREADFUNCTION", CURLOPT_HSTSREADFUNCTION, CURLOT_FUNCTION, 0}, + {"HSTSWRITEDATA", CURLOPT_HSTSWRITEDATA, CURLOT_CBPTR, 0}, + {"HSTSWRITEFUNCTION", CURLOPT_HSTSWRITEFUNCTION, CURLOT_FUNCTION, 0}, + {"HSTS_CTRL", CURLOPT_HSTS_CTRL, CURLOT_LONG, 0}, {"HTTP09_ALLOWED", CURLOPT_HTTP09_ALLOWED, CURLOT_LONG, 0}, {"HTTP200ALIASES", CURLOPT_HTTP200ALIASES, CURLOT_SLIST, 0}, {"HTTPAUTH", CURLOPT_HTTPAUTH, CURLOT_VALUES, 0}, @@ -342,6 +348,6 @@ struct curl_easyoption Curl_easyopts[] = { */ int Curl_easyopts_check(void) { - return (CURLOPT_LASTENTRY != (298 + 1)); + return (CURLOPT_LASTENTRY != (304 + 1)); } #endif diff --git a/libs/libcurl/src/easyoptions.h b/libs/libcurl/src/easyoptions.h index cd8b4100dc..91e11908bd 100644 --- a/libs/libcurl/src/easyoptions.h +++ b/libs/libcurl/src/easyoptions.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/escape.c b/libs/libcurl/src/escape.c index 2bea145f46..683b6fc4a6 100644 --- a/libs/libcurl/src/escape.c +++ b/libs/libcurl/src/escape.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -86,7 +86,7 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string, if(inlength < 0) return NULL; - Curl_dyn_init(&d, CURL_MAX_INPUT_LENGTH); + Curl_dyn_init(&d, CURL_MAX_INPUT_LENGTH * 3); length = (inlength?(size_t)inlength:strlen(string)); if(!length) diff --git a/libs/libcurl/src/escape.h b/libs/libcurl/src/escape.h index 586db7e672..46cb59039a 100644 --- a/libs/libcurl/src/escape.h +++ b/libs/libcurl/src/escape.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/file.c b/libs/libcurl/src/file.c index 1872dfef0d..a65eb7798d 100644 --- a/libs/libcurl/src/file.c +++ b/libs/libcurl/src/file.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -119,8 +119,8 @@ const struct Curl_handler Curl_handler_file = { static CURLcode file_setup_connection(struct connectdata *conn) { /* allocate the FILE specific struct */ - conn->data->req.protop = calloc(1, sizeof(struct FILEPROTO)); - if(!conn->data->req.protop) + conn->data->req.p.file = calloc(1, sizeof(struct FILEPROTO)); + if(!conn->data->req.p.file) return CURLE_OUT_OF_MEMORY; return CURLE_OK; @@ -135,7 +135,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done) { struct Curl_easy *data = conn->data; char *real_path; - struct FILEPROTO *file = data->req.protop; + struct FILEPROTO *file = data->req.p.file; int fd; #ifdef DOS_FILESYSTEM size_t i; @@ -209,7 +209,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done) static CURLcode file_done(struct connectdata *conn, CURLcode status, bool premature) { - struct FILEPROTO *file = conn->data->req.protop; + struct FILEPROTO *file = conn->data->req.p.file; (void)status; /* not used */ (void)premature; /* not used */ @@ -227,18 +227,8 @@ static CURLcode file_done(struct connectdata *conn, static CURLcode file_disconnect(struct connectdata *conn, bool dead_connection) { - struct FILEPROTO *file = conn->data->req.protop; (void)dead_connection; /* not used */ - - if(file) { - Curl_safefree(file->freepath); - file->path = NULL; - if(file->fd != -1) - close(file->fd); - file->fd = -1; - } - - return CURLE_OK; + return file_done(conn, 0, 0); } #ifdef DOS_FILESYSTEM @@ -249,7 +239,7 @@ static CURLcode file_disconnect(struct connectdata *conn, static CURLcode file_upload(struct connectdata *conn) { - struct FILEPROTO *file = conn->data->req.protop; + struct FILEPROTO *file = conn->data->req.p.file; const char *dir = strchr(file->path, DIRSEP); int fd; int mode; @@ -391,7 +381,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done) if(data->set.upload) return file_upload(conn); - file = conn->data->req.protop; + file = conn->data->req.p.file; /* get the fd from the connection phase */ fd = file->fd; diff --git a/libs/libcurl/src/file.h b/libs/libcurl/src/file.h index f6b74a7f72..338f92e46a 100644 --- a/libs/libcurl/src/file.h +++ b/libs/libcurl/src/file.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/fileinfo.c b/libs/libcurl/src/fileinfo.c index 2630c9e460..b7e9f0f5e8 100644 --- a/libs/libcurl/src/fileinfo.c +++ b/libs/libcurl/src/fileinfo.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2010 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2010 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/fileinfo.h b/libs/libcurl/src/fileinfo.h index fdbad8bf2e..5ae23ad4a3 100644 --- a/libs/libcurl/src/fileinfo.h +++ b/libs/libcurl/src/fileinfo.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/firefox-db2pem.sh b/libs/libcurl/src/firefox-db2pem.sh index ee820261eb..629a2e8d64 100644 --- a/libs/libcurl/src/firefox-db2pem.sh +++ b/libs/libcurl/src/firefox-db2pem.sh @@ -10,7 +10,7 @@ # * # * This software is licensed as described in the file COPYING, which # * you should have received as part of this distribution. The terms -# * are also available at https://curl.haxx.se/docs/copyright.html. +# * are also available at https://curl.se/docs/copyright.html. # * # * You may opt to use, copy, modify, merge, publish, distribute and/or sell # * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/formdata.c b/libs/libcurl/src/formdata.c index 1cab2c5c25..769f06a705 100644 --- a/libs/libcurl/src/formdata.c +++ b/libs/libcurl/src/formdata.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/formdata.h b/libs/libcurl/src/formdata.h index 3766d38f2b..5a021ceb92 100644 --- a/libs/libcurl/src/formdata.h +++ b/libs/libcurl/src/formdata.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/ftp.c b/libs/libcurl/src/ftp.c index 11031da6fb..bc35574217 100644 --- a/libs/libcurl/src/ftp.c +++ b/libs/libcurl/src/ftp.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -901,7 +901,6 @@ typedef enum { static CURLcode ftp_state_use_port(struct connectdata *conn, ftpport fcmd) /* start with this */ - { CURLcode result = CURLE_OK; struct ftp_conn *ftpc = &conn->proto.ftpc; @@ -1337,7 +1336,7 @@ static CURLcode ftp_state_use_pasv(struct connectdata *conn) static CURLcode ftp_state_prepare_transfer(struct connectdata *conn) { CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->req.protop; + struct FTP *ftp = conn->data->req.p.ftp; struct Curl_easy *data = conn->data; if(ftp->transfer != FTPTRANSFER_BODY) { @@ -1380,7 +1379,7 @@ static CURLcode ftp_state_prepare_transfer(struct connectdata *conn) static CURLcode ftp_state_rest(struct connectdata *conn) { CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->req.protop; + struct FTP *ftp = conn->data->req.p.ftp; struct ftp_conn *ftpc = &conn->proto.ftpc; if((ftp->transfer != FTPTRANSFER_BODY) && ftpc->file) { @@ -1401,7 +1400,7 @@ static CURLcode ftp_state_rest(struct connectdata *conn) static CURLcode ftp_state_size(struct connectdata *conn) { CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->req.protop; + struct FTP *ftp = conn->data->req.p.ftp; struct ftp_conn *ftpc = &conn->proto.ftpc; if((ftp->transfer == FTPTRANSFER_INFO) && ftpc->file) { @@ -1422,7 +1421,7 @@ static CURLcode ftp_state_list(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct FTP *ftp = data->req.protop; + struct FTP *ftp = data->req.p.ftp; /* If this output is to be machine-parsed, the NLST command might be better to use, since the LIST command output is not specified or standard in any @@ -1498,7 +1497,7 @@ static CURLcode ftp_state_stor_prequote(struct connectdata *conn) static CURLcode ftp_state_type(struct connectdata *conn) { CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->req.protop; + struct FTP *ftp = conn->data->req.p.ftp; struct Curl_easy *data = conn->data; struct ftp_conn *ftpc = &conn->proto.ftpc; @@ -1556,7 +1555,7 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn, bool sizechecked) { CURLcode result = CURLE_OK; - struct FTP *ftp = conn->data->req.protop; + struct FTP *ftp = conn->data->req.p.ftp; struct Curl_easy *data = conn->data; struct ftp_conn *ftpc = &conn->proto.ftpc; @@ -1656,7 +1655,7 @@ static CURLcode ftp_state_quote(struct connectdata *conn, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct FTP *ftp = data->req.protop; + struct FTP *ftp = data->req.p.ftp; struct ftp_conn *ftpc = &conn->proto.ftpc; bool quote = FALSE; struct curl_slist *item; @@ -1941,6 +1940,17 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, #endif { /* normal, direct, ftp connection */ + DEBUGASSERT(ftpc->newhost); + + /* postponed address resolution in case of tcp fastopen */ + if(conn->bits.tcp_fastopen && !conn->bits.reuse && !ftpc->newhost[0]) { + Curl_conninfo_remote(conn, conn->sock[FIRSTSOCKET]); + Curl_safefree(ftpc->newhost); + ftpc->newhost = strdup(control_address(conn)); + if(!ftpc->newhost) + return CURLE_OUT_OF_MEMORY; + } + rc = Curl_resolv(conn, ftpc->newhost, ftpc->newport, FALSE, &addr); if(rc == CURLRESOLV_PENDING) /* BLOCKING */ @@ -2031,7 +2041,7 @@ static CURLcode ftp_state_mdtm_resp(struct connectdata *conn, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct FTP *ftp = data->req.protop; + struct FTP *ftp = data->req.p.ftp; struct ftp_conn *ftpc = &conn->proto.ftpc; switch(ftpcode) { @@ -2164,7 +2174,7 @@ static CURLcode ftp_state_retr(struct connectdata *conn, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct FTP *ftp = data->req.protop; + struct FTP *ftp = data->req.p.ftp; struct ftp_conn *ftpc = &conn->proto.ftpc; if(data->set.max_filesize && (filesize > data->set.max_filesize)) { @@ -2382,7 +2392,7 @@ static CURLcode ftp_state_get_resp(struct connectdata *conn, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct FTP *ftp = data->req.protop; + struct FTP *ftp = data->req.p.ftp; if((ftpcode == 150) || (ftpcode == 125)) { @@ -3133,7 +3143,7 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status, bool premature) { struct Curl_easy *data = conn->data; - struct FTP *ftp = data->req.protop; + struct FTP *ftp = data->req.p.ftp; struct ftp_conn *ftpc = &conn->proto.ftpc; struct pingpong *pp = &ftpc->pp; ssize_t nread; @@ -3498,7 +3508,7 @@ static CURLcode ftp_do_more(struct connectdata *conn, int *completep) bool complete = FALSE; /* the ftp struct is inited in ftp_connect() */ - struct FTP *ftp = data->req.protop; + struct FTP *ftp = data->req.p.ftp; /* if the second connection isn't done yet, wait for it */ if(!conn->bits.tcpconnect[SECONDARYSOCKET]) { @@ -3663,7 +3673,7 @@ CURLcode ftp_perform(struct connectdata *conn, if(conn->data->set.opt_no_body) { /* requested no body means no transfer... */ - struct FTP *ftp = conn->data->req.protop; + struct FTP *ftp = conn->data->req.p.ftp; ftp->transfer = FTPTRANSFER_INFO; } @@ -3698,7 +3708,7 @@ static void wc_data_dtor(void *ptr) static CURLcode init_wc_data(struct connectdata *conn) { char *last_slash; - struct FTP *ftp = conn->data->req.protop; + struct FTP *ftp = conn->data->req.p.ftp; char *path = ftp->path; struct WildcardData *wildcard = &(conn->data->wildcard); CURLcode result = CURLE_OK; @@ -3790,129 +3800,131 @@ static CURLcode init_wc_data(struct connectdata *conn) return result; } -/* This is called recursively */ static CURLcode wc_statemach(struct connectdata *conn) { struct WildcardData * const wildcard = &(conn->data->wildcard); CURLcode result = CURLE_OK; - switch(wildcard->state) { - case CURLWC_INIT: - result = init_wc_data(conn); - if(wildcard->state == CURLWC_CLEAN) - /* only listing! */ - break; - wildcard->state = result ? CURLWC_ERROR : CURLWC_MATCHING; - break; + for(;;) { + switch(wildcard->state) { + case CURLWC_INIT: + result = init_wc_data(conn); + if(wildcard->state == CURLWC_CLEAN) + /* only listing! */ + return result; + wildcard->state = result ? CURLWC_ERROR : CURLWC_MATCHING; + return result; - case CURLWC_MATCHING: { - /* In this state is LIST response successfully parsed, so lets restore - previous WRITEFUNCTION callback and WRITEDATA pointer */ - struct ftp_wc *ftpwc = wildcard->protdata; - conn->data->set.fwrite_func = ftpwc->backup.write_function; - conn->data->set.out = ftpwc->backup.file_descriptor; - ftpwc->backup.write_function = ZERO_NULL; - ftpwc->backup.file_descriptor = NULL; - wildcard->state = CURLWC_DOWNLOADING; - - if(Curl_ftp_parselist_geterror(ftpwc->parser)) { - /* error found in LIST parsing */ - wildcard->state = CURLWC_CLEAN; - return wc_statemach(conn); - } - if(wildcard->filelist.size == 0) { - /* no corresponding file */ - wildcard->state = CURLWC_CLEAN; - return CURLE_REMOTE_FILE_NOT_FOUND; + case CURLWC_MATCHING: { + /* In this state is LIST response successfully parsed, so lets restore + previous WRITEFUNCTION callback and WRITEDATA pointer */ + struct ftp_wc *ftpwc = wildcard->protdata; + conn->data->set.fwrite_func = ftpwc->backup.write_function; + conn->data->set.out = ftpwc->backup.file_descriptor; + ftpwc->backup.write_function = ZERO_NULL; + ftpwc->backup.file_descriptor = NULL; + wildcard->state = CURLWC_DOWNLOADING; + + if(Curl_ftp_parselist_geterror(ftpwc->parser)) { + /* error found in LIST parsing */ + wildcard->state = CURLWC_CLEAN; + continue; + } + if(wildcard->filelist.size == 0) { + /* no corresponding file */ + wildcard->state = CURLWC_CLEAN; + return CURLE_REMOTE_FILE_NOT_FOUND; + } + continue; } - return wc_statemach(conn); - } - case CURLWC_DOWNLOADING: { - /* filelist has at least one file, lets get first one */ - struct ftp_conn *ftpc = &conn->proto.ftpc; - struct curl_fileinfo *finfo = wildcard->filelist.head->ptr; - struct FTP *ftp = conn->data->req.protop; + case CURLWC_DOWNLOADING: { + /* filelist has at least one file, lets get first one */ + struct ftp_conn *ftpc = &conn->proto.ftpc; + struct curl_fileinfo *finfo = wildcard->filelist.head->ptr; + struct FTP *ftp = conn->data->req.p.ftp; - char *tmp_path = aprintf("%s%s", wildcard->path, finfo->filename); - if(!tmp_path) - return CURLE_OUT_OF_MEMORY; + char *tmp_path = aprintf("%s%s", wildcard->path, finfo->filename); + if(!tmp_path) + return CURLE_OUT_OF_MEMORY; - /* switch default ftp->path and tmp_path */ - free(ftp->pathalloc); - ftp->pathalloc = ftp->path = tmp_path; - - infof(conn->data, "Wildcard - START of \"%s\"\n", finfo->filename); - if(conn->data->set.chunk_bgn) { - long userresponse; - Curl_set_in_callback(conn->data, true); - userresponse = conn->data->set.chunk_bgn( - finfo, wildcard->customptr, (int)wildcard->filelist.size); - Curl_set_in_callback(conn->data, false); - switch(userresponse) { - case CURL_CHUNK_BGN_FUNC_SKIP: - infof(conn->data, "Wildcard - \"%s\" skipped by user\n", - finfo->filename); - wildcard->state = CURLWC_SKIP; - return wc_statemach(conn); - case CURL_CHUNK_BGN_FUNC_FAIL: - return CURLE_CHUNK_FAILED; + /* switch default ftp->path and tmp_path */ + free(ftp->pathalloc); + ftp->pathalloc = ftp->path = tmp_path; + + infof(conn->data, "Wildcard - START of \"%s\"\n", finfo->filename); + if(conn->data->set.chunk_bgn) { + long userresponse; + Curl_set_in_callback(conn->data, true); + userresponse = conn->data->set.chunk_bgn( + finfo, wildcard->customptr, (int)wildcard->filelist.size); + Curl_set_in_callback(conn->data, false); + switch(userresponse) { + case CURL_CHUNK_BGN_FUNC_SKIP: + infof(conn->data, "Wildcard - \"%s\" skipped by user\n", + finfo->filename); + wildcard->state = CURLWC_SKIP; + continue; + case CURL_CHUNK_BGN_FUNC_FAIL: + return CURLE_CHUNK_FAILED; + } } - } - if(finfo->filetype != CURLFILETYPE_FILE) { - wildcard->state = CURLWC_SKIP; - return wc_statemach(conn); - } + if(finfo->filetype != CURLFILETYPE_FILE) { + wildcard->state = CURLWC_SKIP; + continue; + } - if(finfo->flags & CURLFINFOFLAG_KNOWN_SIZE) - ftpc->known_filesize = finfo->size; + if(finfo->flags & CURLFINFOFLAG_KNOWN_SIZE) + ftpc->known_filesize = finfo->size; - result = ftp_parse_url_path(conn); - if(result) - return result; + result = ftp_parse_url_path(conn); + if(result) + return result; - /* we don't need the Curl_fileinfo of first file anymore */ - Curl_llist_remove(&wildcard->filelist, wildcard->filelist.head, NULL); + /* we don't need the Curl_fileinfo of first file anymore */ + Curl_llist_remove(&wildcard->filelist, wildcard->filelist.head, NULL); - if(wildcard->filelist.size == 0) { /* remains only one file to down. */ - wildcard->state = CURLWC_CLEAN; - /* after that will be ftp_do called once again and no transfer - will be done because of CURLWC_CLEAN state */ - return CURLE_OK; + if(wildcard->filelist.size == 0) { /* remains only one file to down. */ + wildcard->state = CURLWC_CLEAN; + /* after that will be ftp_do called once again and no transfer + will be done because of CURLWC_CLEAN state */ + return CURLE_OK; + } + return result; } - } break; - case CURLWC_SKIP: { - if(conn->data->set.chunk_end) { - Curl_set_in_callback(conn->data, true); - conn->data->set.chunk_end(conn->data->wildcard.customptr); - Curl_set_in_callback(conn->data, false); + case CURLWC_SKIP: { + if(conn->data->set.chunk_end) { + Curl_set_in_callback(conn->data, true); + conn->data->set.chunk_end(conn->data->wildcard.customptr); + Curl_set_in_callback(conn->data, false); + } + Curl_llist_remove(&wildcard->filelist, wildcard->filelist.head, NULL); + wildcard->state = (wildcard->filelist.size == 0) ? + CURLWC_CLEAN : CURLWC_DOWNLOADING; + continue; } - Curl_llist_remove(&wildcard->filelist, wildcard->filelist.head, NULL); - wildcard->state = (wildcard->filelist.size == 0) ? - CURLWC_CLEAN : CURLWC_DOWNLOADING; - return wc_statemach(conn); - } - case CURLWC_CLEAN: { - struct ftp_wc *ftpwc = wildcard->protdata; - result = CURLE_OK; - if(ftpwc) - result = Curl_ftp_parselist_geterror(ftpwc->parser); + case CURLWC_CLEAN: { + struct ftp_wc *ftpwc = wildcard->protdata; + result = CURLE_OK; + if(ftpwc) + result = Curl_ftp_parselist_geterror(ftpwc->parser); - wildcard->state = result ? CURLWC_ERROR : CURLWC_DONE; - } break; + wildcard->state = result ? CURLWC_ERROR : CURLWC_DONE; + return result; + } - case CURLWC_DONE: - case CURLWC_ERROR: - case CURLWC_CLEAR: - if(wildcard->dtor) - wildcard->dtor(wildcard->protdata); - break; + case CURLWC_DONE: + case CURLWC_ERROR: + case CURLWC_CLEAR: + if(wildcard->dtor) + wildcard->dtor(wildcard->protdata); + return result; + } } - - return result; + /* UNREACHABLE */ } /*********************************************************************** @@ -4039,7 +4051,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn) { struct Curl_easy *data = conn->data; /* the ftp struct is already inited in ftp_connect() */ - struct FTP *ftp = data->req.protop; + struct FTP *ftp = data->req.p.ftp; struct ftp_conn *ftpc = &conn->proto.ftpc; const char *slashPos = NULL; const char *fileName = NULL; @@ -4184,7 +4196,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn) static CURLcode ftp_dophase_done(struct connectdata *conn, bool connected) { - struct FTP *ftp = conn->data->req.protop; + struct FTP *ftp = conn->data->req.p.ftp; struct ftp_conn *ftpc = &conn->proto.ftpc; if(connected) { @@ -4281,7 +4293,7 @@ static CURLcode ftp_setup_connection(struct connectdata *conn) char *type; struct FTP *ftp; - conn->data->req.protop = ftp = calloc(sizeof(struct FTP), 1); + conn->data->req.p.ftp = ftp = calloc(sizeof(struct FTP), 1); if(NULL == ftp) return CURLE_OUT_OF_MEMORY; diff --git a/libs/libcurl/src/ftp.h b/libs/libcurl/src/ftp.h index dbbdeb7cc9..3ca1458ed8 100644 --- a/libs/libcurl/src/ftp.h +++ b/libs/libcurl/src/ftp.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/ftplistparser.c b/libs/libcurl/src/ftplistparser.c index c7b84a9ffd..85b8a78d4f 100644 --- a/libs/libcurl/src/ftplistparser.c +++ b/libs/libcurl/src/ftplistparser.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/ftplistparser.h b/libs/libcurl/src/ftplistparser.h index b34ae9b63a..e4cd8201d9 100644 --- a/libs/libcurl/src/ftplistparser.h +++ b/libs/libcurl/src/ftplistparser.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/getenv.c b/libs/libcurl/src/getenv.c index 9385b8f677..92c53505c6 100644 --- a/libs/libcurl/src/getenv.c +++ b/libs/libcurl/src/getenv.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/getinfo.c b/libs/libcurl/src/getinfo.c index 49e79e476f..fd8f4e8430 100644 --- a/libs/libcurl/src/getinfo.c +++ b/libs/libcurl/src/getinfo.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/getinfo.h b/libs/libcurl/src/getinfo.h index 8d2af4266d..f35d1b4b34 100644 --- a/libs/libcurl/src/getinfo.h +++ b/libs/libcurl/src/getinfo.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/gopher.c b/libs/libcurl/src/gopher.c index ce7413133f..b101c0ab68 100644 --- a/libs/libcurl/src/gopher.c +++ b/libs/libcurl/src/gopher.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -124,8 +124,6 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done) sel_org = sel; } - /* We use Curl_write instead of Curl_sendf to make sure the entire buffer is - sent, which could be sizeable with long selectors. */ k = curlx_uztosz(len); for(;;) { diff --git a/libs/libcurl/src/gopher.h b/libs/libcurl/src/gopher.h index dec2557fc6..b35fa45096 100644 --- a/libs/libcurl/src/gopher.h +++ b/libs/libcurl/src/gopher.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hash.c b/libs/libcurl/src/hash.c index 8c1f6cd0a6..051c176269 100644 --- a/libs/libcurl/src/hash.c +++ b/libs/libcurl/src/hash.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hash.h b/libs/libcurl/src/hash.h index eb5104b85b..b7f828e071 100644 --- a/libs/libcurl/src/hash.h +++ b/libs/libcurl/src/hash.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hmac.c b/libs/libcurl/src/hmac.c index e4fea8a507..590abe6d2e 100644 --- a/libs/libcurl/src/hmac.c +++ b/libs/libcurl/src/hmac.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hostasyn.c b/libs/libcurl/src/hostasyn.c index ed9190f4c6..56a6fc2b72 100644 --- a/libs/libcurl/src/hostasyn.c +++ b/libs/libcurl/src/hostasyn.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hostcheck.c b/libs/libcurl/src/hostcheck.c index 9e0db05fac..0fef98b2ad 100644 --- a/libs/libcurl/src/hostcheck.c +++ b/libs/libcurl/src/hostcheck.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hostcheck.h b/libs/libcurl/src/hostcheck.h index 9c180856ad..52155f43b4 100644 --- a/libs/libcurl/src/hostcheck.h +++ b/libs/libcurl/src/hostcheck.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hostip.c b/libs/libcurl/src/hostip.c index 57c8bd3d84..ab1f6df051 100644 --- a/libs/libcurl/src/hostip.c +++ b/libs/libcurl/src/hostip.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hostip.h b/libs/libcurl/src/hostip.h index fb782d5638..724a03d7fb 100644 --- a/libs/libcurl/src/hostip.h +++ b/libs/libcurl/src/hostip.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hostip4.c b/libs/libcurl/src/hostip4.c index eae9416741..df83a2f12b 100644 --- a/libs/libcurl/src/hostip4.c +++ b/libs/libcurl/src/hostip4.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hostip6.c b/libs/libcurl/src/hostip6.c index 11215758dd..02b0ca298b 100644 --- a/libs/libcurl/src/hostip6.c +++ b/libs/libcurl/src/hostip6.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hostsyn.c b/libs/libcurl/src/hostsyn.c index 9e31008d2c..550b43a085 100644 --- a/libs/libcurl/src/hostsyn.c +++ b/libs/libcurl/src/hostsyn.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/hsts.c b/libs/libcurl/src/hsts.c new file mode 100644 index 0000000000..6f771284ff --- /dev/null +++ b/libs/libcurl/src/hsts.c @@ -0,0 +1,522 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ +/* + * The Strict-Transport-Security header is defined in RFC 6797: + * https://tools.ietf.org/html/rfc6797 + */ +#include "curl_setup.h" + +#if !defined(CURL_DISABLE_HTTP) && defined(USE_HSTS) +#include <curl/curl.h> +#include "urldata.h" +#include "llist.h" +#include "hsts.h" +#include "curl_get_line.h" +#include "strcase.h" +#include "sendf.h" +#include "strtoofft.h" +#include "parsedate.h" +#include "rand.h" +#include "rename.h" + +/* The last 3 #include files should be in this order */ +#include "curl_printf.h" +#include "curl_memory.h" +#include "memdebug.h" + +#define MAX_HSTS_LINE 4095 +#define MAX_HSTS_HOSTLEN 256 +#define MAX_HSTS_HOSTLENSTR "256" +#define MAX_HSTS_SUBLEN 4 +#define MAX_HSTS_SUBLENSTR "4" +#define MAX_HSTS_DATELEN 64 +#define MAX_HSTS_DATELENSTR "64" + +#ifdef DEBUGBUILD +/* to play well with debug builds, we can *set* a fixed time this will + return */ +time_t deltatime; /* allow for "adjustments" for unit test purposes */ +static time_t debugtime(void *unused) +{ + char *timestr = getenv("CURL_TIME"); + (void)unused; + if(timestr) { + unsigned long val = strtol(timestr, NULL, 10) + deltatime; + return (time_t)val; + } + return time(NULL); +} +#define time(x) debugtime(x) +#endif + +struct hsts *Curl_hsts_init(void) +{ + struct hsts *h = calloc(sizeof(struct hsts), 1); + if(h) { + Curl_llist_init(&h->list, NULL); + } + return h; +} + +static void hsts_free(struct stsentry *e) +{ + free((char *)e->host); + free(e); +} + +void Curl_hsts_cleanup(struct hsts **hp) +{ + struct hsts *h = *hp; + if(h) { + struct Curl_llist_element *e; + struct Curl_llist_element *n; + for(e = h->list.head; e; e = n) { + struct stsentry *sts = e->ptr; + n = e->next; + hsts_free(sts); + } + free(h->filename); + free(h); + *hp = NULL; + } +} + +static struct stsentry *hsts_entry(void) +{ + return calloc(sizeof(struct stsentry), 1); +} + +static CURLcode hsts_create(struct hsts *h, + const char *hostname, + bool subdomains, + curl_off_t expires) +{ + struct stsentry *sts = hsts_entry(); + if(!sts) + return CURLE_OUT_OF_MEMORY; + + sts->expires = expires; + sts->includeSubDomains = subdomains; + sts->host = strdup(hostname); + if(!sts->host) { + free(sts); + return CURLE_OUT_OF_MEMORY; + } + Curl_llist_insert_next(&h->list, h->list.tail, sts, &sts->node); + return CURLE_OK; +} + +CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, + const char *header) +{ + const char *p = header; + curl_off_t expires = 0; + bool gotma = FALSE; + bool gotinc = FALSE; + bool subdomains = FALSE; + struct stsentry *sts; + time_t now = time(NULL); + + do { + while(*p && ISSPACE(*p)) + p++; + if(Curl_strncasecompare("max-age=", p, 8)) { + bool quoted = FALSE; + CURLofft offt; + char *endp; + + if(gotma) + return CURLE_BAD_FUNCTION_ARGUMENT; + + p += 8; + while(*p && ISSPACE(*p)) + p++; + if(*p == '\"') { + p++; + quoted = TRUE; + } + offt = curlx_strtoofft(p, &endp, 10, &expires); + if(offt == CURL_OFFT_FLOW) + expires = CURL_OFF_T_MAX; + else if(offt) + /* invalid max-age */ + return CURLE_BAD_FUNCTION_ARGUMENT; + p = endp; + if(quoted) { + if(*p != '\"') + return CURLE_BAD_FUNCTION_ARGUMENT; + p++; + } + gotma = TRUE; + } + else if(Curl_strncasecompare("includesubdomains", p, 17)) { + if(gotinc) + return CURLE_BAD_FUNCTION_ARGUMENT; + subdomains = TRUE; + p += 17; + gotinc = TRUE; + } + else { + /* unknown directive, do a lame attempt to skip */ + while(*p && (*p != ';')) + p++; + } + + while(*p && ISSPACE(*p)) + p++; + if(*p == ';') + p++; + } while (*p); + + if(!gotma) + /* max-age is mandatory */ + return CURLE_BAD_FUNCTION_ARGUMENT; + + if(!expires) { + /* remove the entry if present verbatim (without subdomain match) */ + sts = Curl_hsts(h, hostname, FALSE); + if(sts) { + Curl_llist_remove(&h->list, &sts->node, NULL); + hsts_free(sts); + } + return CURLE_OK; + } + + if(CURL_OFF_T_MAX - now < expires) + /* would overflow, use maximum value */ + expires = CURL_OFF_T_MAX; + else + expires += now; + + /* check if it already exists */ + sts = Curl_hsts(h, hostname, FALSE); + if(sts) { + /* just update these fields */ + sts->expires = expires; + sts->includeSubDomains = subdomains; + } + else + return hsts_create(h, hostname, subdomains, expires); + + return CURLE_OK; +} + +/* + * Return TRUE if the given host name is currently an HSTS one. + * + * The 'subdomain' argument tells the function if subdomain matching should be + * attempted. + */ +struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, + bool subdomain) +{ + if(h) { + time_t now = time(NULL); + size_t hlen = strlen(hostname); + struct Curl_llist_element *e; + struct Curl_llist_element *n; + for(e = h->list.head; e; e = n) { + struct stsentry *sts = e->ptr; + n = e->next; + if(sts->expires <= now) { + /* remove expired entries */ + Curl_llist_remove(&h->list, &sts->node, NULL); + hsts_free(sts); + continue; + } + if(subdomain && sts->includeSubDomains) { + size_t ntail = strlen(sts->host); + if(ntail < hlen) { + size_t offs = hlen - ntail; + if((hostname[offs-1] == '.') && + Curl_strncasecompare(&hostname[offs], sts->host, ntail)) + return sts; + } + } + if(Curl_strcasecompare(hostname, sts->host)) + return sts; + } + } + return NULL; /* no match */ +} + +/* + * Send this HSTS entry to the write callback. + */ +static CURLcode hsts_push(struct Curl_easy *data, + struct curl_index *i, + struct stsentry *sts, + bool *stop) +{ + struct curl_hstsentry e; + CURLSTScode sc; + struct tm stamp; + CURLcode result; + + e.name = (char *)sts->host; + e.namelen = strlen(sts->host); + e.includeSubDomains = sts->includeSubDomains; + + result = Curl_gmtime(sts->expires, &stamp); + if(result) + return result; + + msnprintf(e.expire, sizeof(e.expire), "%d%02d%02d %02d:%02d:%02d", + stamp.tm_year + 1900, stamp.tm_mon + 1, stamp.tm_mday, + stamp.tm_hour, stamp.tm_min, stamp.tm_sec); + + sc = data->set.hsts_write(data, &e, i, + data->set.hsts_write_userp); + *stop = (sc != CURLSTS_OK); + return sc == CURLSTS_FAIL ? CURLE_BAD_FUNCTION_ARGUMENT : CURLE_OK; +} + +/* + * Write this single hsts entry to a single output line + */ +static CURLcode hsts_out(struct stsentry *sts, FILE *fp) +{ + struct tm stamp; + CURLcode result = Curl_gmtime(sts->expires, &stamp); + if(result) + return result; + + fprintf(fp, "%s%s \"%d%02d%02d %02d:%02d:%02d\"\n", + sts->includeSubDomains ? ".": "", sts->host, + stamp.tm_year + 1900, stamp.tm_mon + 1, stamp.tm_mday, + stamp.tm_hour, stamp.tm_min, stamp.tm_sec); + return CURLE_OK; +} + + +/* + * Curl_https_save() writes the HSTS cache to file and callback. + */ +CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, + const char *file) +{ + struct Curl_llist_element *e; + struct Curl_llist_element *n; + CURLcode result = CURLE_OK; + FILE *out; + char *tempstore; + unsigned char randsuffix[9]; + + if(!h) + /* no cache activated */ + return CURLE_OK; + + /* if not new name is given, use the one we stored from the load */ + if(!file && h->filename) + file = h->filename; + + if((h->flags & CURLHSTS_READONLYFILE) || !file || !file[0]) + /* marked as read-only, no file or zero length file name */ + goto skipsave; + + if(Curl_rand_hex(data, randsuffix, sizeof(randsuffix))) + return CURLE_FAILED_INIT; + + tempstore = aprintf("%s.%s.tmp", file, randsuffix); + if(!tempstore) + return CURLE_OUT_OF_MEMORY; + + out = fopen(tempstore, FOPEN_WRITETEXT); + if(!out) + result = CURLE_WRITE_ERROR; + else { + fputs("# Your HSTS cache. https://curl.se/docs/hsts.html\n" + "# This file was generated by libcurl! Edit at your own risk.\n", + out); + for(e = h->list.head; e; e = n) { + struct stsentry *sts = e->ptr; + n = e->next; + result = hsts_out(sts, out); + if(result) + break; + } + fclose(out); + if(!result && Curl_rename(tempstore, file)) + result = CURLE_WRITE_ERROR; + + if(result) + unlink(tempstore); + } + free(tempstore); + skipsave: + if(data->set.hsts_write) { + /* if there's a write callback */ + struct curl_index i; /* count */ + i.total = h->list.size; + i.index = 0; + for(e = h->list.head; e; e = n) { + struct stsentry *sts = e->ptr; + bool stop; + n = e->next; + result = hsts_push(data, &i, sts, &stop); + if(result || stop) + break; + i.index++; + } + } + return result; +} + +/* only returns SERIOUS errors */ +static CURLcode hsts_add(struct hsts *h, char *line) +{ + /* Example lines: + example.com "20191231 10:00:00" + .example.net "20191231 10:00:00" + */ + char host[MAX_HSTS_HOSTLEN + 1]; + char date[MAX_HSTS_DATELEN + 1]; + int rc; + + rc = sscanf(line, + "%" MAX_HSTS_HOSTLENSTR "s \"%" MAX_HSTS_DATELENSTR "[^\"]\"", + host, date); + if(2 == rc) { + time_t expires = Curl_getdate_capped(date); + CURLcode result; + char *p = host; + bool subdomain = FALSE; + if(p[0] == '.') { + p++; + subdomain = TRUE; + } + result = hsts_create(h, p, subdomain, expires); + if(result) + return result; + } + + return CURLE_OK; +} + +/* + * Load HSTS data from callback. + * + */ +static CURLcode hsts_pull(struct Curl_easy *data, struct hsts *h) +{ + /* if the HSTS read callback is set, use it */ + if(data->set.hsts_read) { + CURLSTScode sc; + DEBUGASSERT(h); + do { + char buffer[257]; + struct curl_hstsentry e; + e.name = buffer; + e.namelen = sizeof(buffer)-1; + e.includeSubDomains = FALSE; /* default */ + e.expire[0] = 0; + e.name[0] = 0; /* just to make it clean */ + sc = data->set.hsts_read(data, &e, data->set.hsts_read_userp); + if(sc == CURLSTS_OK) { + time_t expires; + CURLcode result; + if(!e.name[0]) + /* bail out if no name was stored */ + return CURLE_BAD_FUNCTION_ARGUMENT; + if(e.expire[0]) + expires = Curl_getdate_capped(e.expire); + else + expires = TIME_T_MAX; /* the end of time */ + result = hsts_create(h, e.name, e.includeSubDomains, expires); + if(result) + return result; + } + else if(sc == CURLSTS_FAIL) + return CURLE_BAD_FUNCTION_ARGUMENT; + } while(sc == CURLSTS_OK); + } + return CURLE_OK; +} + +/* + * Load the HSTS cache from the given file. The text based line-oriented file + * format is documented here: + * https://github.com/curl/curl/wiki/HSTS + * + * This function only returns error on major problems that prevents hsts + * handling to work completely. It will ignore individual syntactical errors + * etc. + */ +static CURLcode hsts_load(struct hsts *h, const char *file) +{ + CURLcode result = CURLE_OK; + char *line = NULL; + FILE *fp; + + /* we need a private copy of the file name so that the hsts cache file + name survives an easy handle reset */ + free(h->filename); + h->filename = strdup(file); + if(!h->filename) + return CURLE_OUT_OF_MEMORY; + + fp = fopen(file, FOPEN_READTEXT); + if(fp) { + line = malloc(MAX_HSTS_LINE); + if(!line) + goto fail; + while(Curl_get_line(line, MAX_HSTS_LINE, fp)) { + char *lineptr = line; + while(*lineptr && ISBLANK(*lineptr)) + lineptr++; + if(*lineptr == '#') + /* skip commented lines */ + continue; + + hsts_add(h, lineptr); + } + free(line); /* free the line buffer */ + fclose(fp); + } + return result; + + fail: + Curl_safefree(h->filename); + fclose(fp); + return CURLE_OUT_OF_MEMORY; +} + +/* + * Curl_hsts_loadfile() loads HSTS from file + */ +CURLcode Curl_hsts_loadfile(struct Curl_easy *data, + struct hsts *h, const char *file) +{ + DEBUGASSERT(h); + (void)data; + return hsts_load(h, file); +} + +/* + * Curl_hsts_loadcb() loads HSTS from callback + */ +CURLcode Curl_hsts_loadcb(struct Curl_easy *data, struct hsts *h) +{ + return hsts_pull(data, h); +} + +#endif /* CURL_DISABLE_HTTP || USE_HSTS */ diff --git a/libs/libcurl/src/hsts.h b/libs/libcurl/src/hsts.h new file mode 100644 index 0000000000..ae5db74a24 --- /dev/null +++ b/libs/libcurl/src/hsts.h @@ -0,0 +1,65 @@ +#ifndef HEADER_CURL_HSTS_H +#define HEADER_CURL_HSTS_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at https://curl.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ +#include "curl_setup.h" + +#if !defined(CURL_DISABLE_HTTP) && defined(USE_HSTS) +#include <curl/curl.h> +#include "llist.h" + +#ifdef DEBUGBUILD +extern time_t deltatime; +#endif + +struct stsentry { + struct Curl_llist_element node; + const char *host; + bool includeSubDomains; + time_t expires; /* the timestamp of this entry's expiry */ +}; + +/* The HSTS cache. Needs to be able to tailmatch host names. */ +struct hsts { + struct Curl_llist list; + char *filename; + unsigned int flags; +}; + +struct hsts *Curl_hsts_init(void); +void Curl_hsts_cleanup(struct hsts **hp); +CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, + const char *sts); +struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, + bool subdomain); +CURLcode Curl_hsts_save(struct Curl_easy *data, struct hsts *h, + const char *file); +CURLcode Curl_hsts_loadfile(struct Curl_easy *data, + struct hsts *h, const char *file); +CURLcode Curl_hsts_loadcb(struct Curl_easy *data, + struct hsts *h); +#else +#define Curl_hsts_cleanup(x) +#define Curl_hsts_loadcb(x,y) +#define Curl_hsts_save(x,y,z) +#endif /* CURL_DISABLE_HTTP || USE_HSTS */ +#endif /* HEADER_CURL_HSTS_H */ diff --git a/libs/libcurl/src/http.c b/libs/libcurl/src/http.c index e0be17d9ba..c232ed4134 100644 --- a/libs/libcurl/src/http.c +++ b/libs/libcurl/src/http.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -77,6 +77,7 @@ #include "connect.h" #include "strdup.h" #include "altsvc.h" +#include "hsts.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" @@ -164,14 +165,14 @@ static CURLcode http_setup_conn(struct connectdata *conn) during this request */ struct HTTP *http; struct Curl_easy *data = conn->data; - DEBUGASSERT(data->req.protop == NULL); + DEBUGASSERT(data->req.p.http == NULL); http = calloc(1, sizeof(struct HTTP)); if(!http) return CURLE_OUT_OF_MEMORY; Curl_mime_initpart(&http->form, conn->data); - data->req.protop = http; + data->req.p.http = http; if(data->set.httpversion == CURL_HTTP_VERSION_3) { if(conn->handler->flags & PROTOPT_SSL) @@ -427,7 +428,7 @@ static bool pickoneauth(struct auth *pick, unsigned long mask) static CURLcode http_perhapsrewind(struct connectdata *conn) { struct Curl_easy *data = conn->data; - struct HTTP *http = data->req.protop; + struct HTTP *http = data->req.p.http; curl_off_t bytessent; curl_off_t expectsend = -1; /* default is unknown */ @@ -1111,7 +1112,7 @@ static size_t readmoredata(char *buffer, void *userp) { struct connectdata *conn = (struct connectdata *)userp; - struct HTTP *http = conn->data->req.protop; + struct HTTP *http = conn->data->req.p.http; size_t fullsize = size * nitems; if(!http->postsize) @@ -1169,7 +1170,7 @@ CURLcode Curl_buffer_send(struct dynbuf *in, char *ptr; size_t size; struct Curl_easy *data = conn->data; - struct HTTP *http = data->req.protop; + struct HTTP *http = data->req.p.http; size_t sendsize; curl_socket_t sockfd; size_t headersize; @@ -1254,16 +1255,12 @@ CURLcode Curl_buffer_send(struct dynbuf *in, size_t headlen = (size_t)amount>headersize ? headersize : (size_t)amount; size_t bodylen = amount - headlen; - if(data->set.verbose) { - /* this data _may_ contain binary stuff */ - Curl_debug(data, CURLINFO_HEADER_OUT, ptr, headlen); - if(bodylen) { - /* there was body data sent beyond the initial header part, pass that - on to the debug callback too */ - Curl_debug(data, CURLINFO_DATA_OUT, - ptr + headlen, bodylen); - } - } + /* this data _may_ contain binary stuff */ + Curl_debug(data, CURLINFO_HEADER_OUT, ptr, headlen); + if(bodylen) + /* there was body data sent beyond the initial header part, pass that on + to the debug callback too */ + Curl_debug(data, CURLINFO_DATA_OUT, ptr + headlen, bodylen); /* 'amount' can never be a very large value here so typecasting it so a signed 31 bit value should not cause problems even if ssize_t is @@ -1519,7 +1516,7 @@ CURLcode Curl_http_done(struct connectdata *conn, CURLcode status, bool premature) { struct Curl_easy *data = conn->data; - struct HTTP *http = data->req.protop; + struct HTTP *http = data->req.p.http; /* Clear multipass flag. If authentication isn't done yet, then it will get * a chance to be set back to true when we output the next auth header */ @@ -1980,7 +1977,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) return result; } } - http = data->req.protop; + http = data->req.p.http; DEBUGASSERT(http); if(!data->state.this_is_a_follow) { @@ -2518,7 +2515,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) if(result) return result; -#ifdef USE_ALTSVC +#ifndef CURL_DISABLE_ALTSVC if(conn->bits.altused && !Curl_checkheaders(conn, "Alt-Used")) { altused = aprintf("Alt-Used: %s:%d\r\n", conn->conn_to_host.name, conn->conn_to_port); @@ -2873,20 +2870,24 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) } else { if(postsize) { + char chunk[16]; /* Append the POST data chunky-style */ - result = Curl_dyn_addf(&req, "%x\r\n", (int)postsize); + msnprintf(chunk, sizeof(chunk), "%x\r\n", (int)postsize); + result = Curl_dyn_add(&req, chunk); if(!result) { + included_body = postsize + strlen(chunk); result = Curl_dyn_addn(&req, data->set.postfields, (size_t)postsize); if(!result) result = Curl_dyn_add(&req, "\r\n"); - included_body = postsize + 2; + included_body += 2; } } - if(!result) + if(!result) { result = Curl_dyn_add(&req, "\x30\x0d\x0a\x0d\x0a"); - /* 0 CR LF CR LF */ - included_body += 5; + /* 0 CR LF CR LF */ + included_body += 5; + } } if(result) return result; @@ -3533,10 +3534,8 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data, k->keepon &= ~KEEP_RECV; } - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, - str_start, headerlen); - break; /* exit header line loop */ + Curl_debug(data, CURLINFO_HEADER_IN, str_start, headerlen); + break; /* exit header line loop */ } /* We continue reading headers, reset the line-based header */ @@ -3992,7 +3991,24 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data, } } } -#ifdef USE_ALTSVC + +#ifdef USE_HSTS + /* If enabled, the header is incoming and this is over HTTPS */ + else if(data->hsts && checkprefix("Strict-Transport-Security:", headp) && + (conn->handler->flags & PROTOPT_SSL)) { + CURLcode check = + Curl_hsts_parse(data->hsts, data->state.up.hostname, + &headp[ sizeof("Strict-Transport-Security:") -1 ]); + if(check) + infof(data, "Illegal STS header skipped\n"); +#ifdef DEBUGBUILD + else + infof(data, "Parsed STS header fine (%zu entries)\n", + data->hsts->list.size); +#endif + } +#endif +#ifndef CURL_DISABLE_ALTSVC /* If enabled, the header is incoming and this is over HTTPS */ else if(data->asi && checkprefix("Alt-Svc:", headp) && ((conn->handler->flags & PROTOPT_SSL) || @@ -4027,9 +4043,8 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data, if(data->set.include_header) writetype |= CLIENTWRITE_BODY; - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, headp, - Curl_dyn_len(&data->state.headerb)); + Curl_debug(data, CURLINFO_HEADER_IN, headp, + Curl_dyn_len(&data->state.headerb)); result = Curl_client_write(conn, writetype, headp, Curl_dyn_len(&data->state.headerb)); diff --git a/libs/libcurl/src/http.h b/libs/libcurl/src/http.h index 9ea3eb2830..1aaec225e2 100644 --- a/libs/libcurl/src/http.h +++ b/libs/libcurl/src/http.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/http2.c b/libs/libcurl/src/http2.c index 925d9828b2..b138fb4b0f 100644 --- a/libs/libcurl/src/http2.c +++ b/libs/libcurl/src/http2.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -257,7 +257,7 @@ static unsigned int http2_conncheck(struct connectdata *check, /* called from http_setup_conn */ void Curl_http2_setup_req(struct Curl_easy *data) { - struct HTTP *http = data->req.protop; + struct HTTP *http = data->req.p.http; http->bodystarted = FALSE; http->status_code = -1; http->pausedata = NULL; @@ -393,7 +393,7 @@ char *curl_pushheader_bynum(struct curl_pushheaders *h, size_t num) if(!h || !GOOD_EASY_HANDLE(h->data)) return NULL; else { - struct HTTP *stream = h->data->req.protop; + struct HTTP *stream = h->data->req.p.http; if(num < stream->push_headers_used) return stream->push_headers[num]; } @@ -415,7 +415,7 @@ char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header) !strcmp(header, ":") || strchr(header + 1, ':')) return NULL; else { - struct HTTP *stream = h->data->req.protop; + struct HTTP *stream = h->data->req.p.http; size_t len = strlen(header); size_t i; for(i = 0; i<stream->push_headers_used; i++) { @@ -462,7 +462,7 @@ static struct Curl_easy *duphandle(struct Curl_easy *data) (void)Curl_close(&second); } else { - second->req.protop = http; + second->req.p.http = http; Curl_dyn_init(&http->header_recvbuf, DYN_H2_HEADERS); Curl_http2_setup_req(second); second->state.stream_weight = data->state.stream_weight; @@ -539,7 +539,7 @@ static int push_promise(struct Curl_easy *data, /* ask the application */ H2BUGF(infof(data, "Got PUSH_PROMISE, ask application!\n")); - stream = data->req.protop; + stream = data->req.p.http; if(!stream) { failf(data, "Internal NULL stream!\n"); (void)Curl_close(&newhandle); @@ -569,13 +569,13 @@ static int push_promise(struct Curl_easy *data, if(rv) { DEBUGASSERT((rv > CURL_PUSH_OK) && (rv <= CURL_PUSH_ERROROUT)); /* denied, kill off the new handle again */ - http2_stream_free(newhandle->req.protop); - newhandle->req.protop = NULL; + http2_stream_free(newhandle->req.p.http); + newhandle->req.p.http = NULL; (void)Curl_close(&newhandle); goto fail; } - newstream = newhandle->req.protop; + newstream = newhandle->req.p.http; newstream->stream_id = frame->promised_stream_id; newhandle->req.maxdownload = -1; newhandle->req.size = -1; @@ -585,8 +585,8 @@ static int push_promise(struct Curl_easy *data, rc = Curl_multi_add_perform(data->multi, newhandle, conn); if(rc) { infof(data, "failed to add handle to multi\n"); - http2_stream_free(newhandle->req.protop); - newhandle->req.protop = NULL; + http2_stream_free(newhandle->req.p.http); + newhandle->req.p.http = NULL; Curl_close(&newhandle); rv = CURL_PUSH_DENY; goto fail; @@ -669,7 +669,7 @@ static int on_frame_recv(nghttp2_session *session, const nghttp2_frame *frame, return 0; } - stream = data_s->req.protop; + stream = data_s->req.p.http; if(!stream) { H2BUGF(infof(data_s, "No proto pointer for stream: %x\n", stream_id)); @@ -785,7 +785,7 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags, internal error more than anything else! */ return NGHTTP2_ERR_CALLBACK_FAILURE; - stream = data_s->req.protop; + stream = data_s->req.p.http; if(!stream) return NGHTTP2_ERR_CALLBACK_FAILURE; @@ -851,7 +851,7 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id, } H2BUGF(infof(data_s, "on_stream_close(), %s (err %d), stream %u\n", nghttp2_http2_strerror(error_code), error_code, stream_id)); - stream = data_s->req.protop; + stream = data_s->req.p.http; if(!stream) return NGHTTP2_ERR_CALLBACK_FAILURE; @@ -896,7 +896,7 @@ static int on_begin_headers(nghttp2_session *session, return 0; } - stream = data_s->req.protop; + stream = data_s->req.p.http; if(!stream || !stream->bodystarted) { return 0; } @@ -954,7 +954,7 @@ static int on_header(nghttp2_session *session, const nghttp2_frame *frame, internal error more than anything else! */ return NGHTTP2_ERR_CALLBACK_FAILURE; - stream = data_s->req.protop; + stream = data_s->req.p.http; if(!stream) { failf(data_s, "Internal NULL stream! 5\n"); return NGHTTP2_ERR_CALLBACK_FAILURE; @@ -1102,7 +1102,7 @@ static ssize_t data_source_read_callback(nghttp2_session *session, internal error more than anything else! */ return NGHTTP2_ERR_CALLBACK_FAILURE; - stream = data_s->req.protop; + stream = data_s->req.p.http; if(!stream) return NGHTTP2_ERR_CALLBACK_FAILURE; } @@ -1163,7 +1163,7 @@ static void populate_settings(struct connectdata *conn, void Curl_http2_done(struct Curl_easy *data, bool premature) { - struct HTTP *http = data->req.protop; + struct HTTP *http = data->req.p.http; struct http_conn *httpc = &data->conn->proto.httpc; /* there might be allocated resources done before this got the 'h2' pointer @@ -1400,7 +1400,7 @@ CURLcode Curl_http2_done_sending(struct connectdata *conn) (conn->handler == &Curl_handler_http2)) { /* make sure this is only attempted for HTTP/2 transfers */ - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; struct http_conn *httpc = &conn->proto.httpc; nghttp2_session *h2 = httpc->h2; @@ -1496,8 +1496,7 @@ static ssize_t http2_handle_stream_close(struct connectdata *conn, break; len = lf + 1 - trailp; - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, trailp, len); + Curl_debug(data, CURLINFO_HEADER_IN, trailp, len); /* pass the trailers one by one to the callback */ result = Curl_client_write(conn, CLIENTWRITE_HEADER, trailp, len); if(result) { @@ -1524,7 +1523,7 @@ static void h2_pri_spec(struct Curl_easy *data, nghttp2_priority_spec *pri_spec) { struct HTTP *depstream = (data->set.stream_depends_on? - data->set.stream_depends_on->req.protop:NULL); + data->set.stream_depends_on->req.p.http:NULL); int32_t depstream_id = depstream? depstream->stream_id:0; nghttp2_priority_spec_init(pri_spec, depstream_id, data->set.stream_weight, data->set.stream_depends_e); @@ -1541,7 +1540,7 @@ static void h2_pri_spec(struct Curl_easy *data, static int h2_session_send(struct Curl_easy *data, nghttp2_session *h2) { - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; if((data->set.stream_weight != data->state.stream_weight) || (data->set.stream_depends_e != data->state.stream_depends_e) || (data->set.stream_depends_on != data->state.stream_depends_on) ) { @@ -1569,7 +1568,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex, ssize_t nread; struct http_conn *httpc = &conn->proto.httpc; struct Curl_easy *data = conn->data; - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; (void)sockindex; /* we always do HTTP2 on sockindex 0 */ @@ -1841,7 +1840,7 @@ static ssize_t http2_send(struct connectdata *conn, int sockindex, */ int rv; struct http_conn *httpc = &conn->proto.httpc; - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; nghttp2_nv *nva = NULL; size_t nheader; size_t i; @@ -2071,7 +2070,7 @@ static ssize_t http2_send(struct connectdata *conn, int sockindex, if(acc > MAX_ACC) { infof(conn->data, "http2_send: Warning: The cumulative length of all " - "headers exceeds %zu bytes and that could cause the " + "headers exceeds %d bytes and that could cause the " "stream to be rejected.\n", MAX_ACC); } } @@ -2155,7 +2154,7 @@ CURLcode Curl_http2_setup(struct connectdata *conn) { CURLcode result; struct http_conn *httpc = &conn->proto.httpc; - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; DEBUGASSERT(conn->data->state.buffer); @@ -2209,7 +2208,7 @@ CURLcode Curl_http2_switched(struct connectdata *conn, struct http_conn *httpc = &conn->proto.httpc; int rv; struct Curl_easy *data = conn->data; - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; result = Curl_http2_setup(conn); if(result) @@ -2270,7 +2269,7 @@ CURLcode Curl_http2_switched(struct connectdata *conn, data into stream->mem, overwriting data already there. */ if(H2_BUFSIZE < nread) { failf(data, "connection buffer size is too small to store data following " - "HTTP Upgrade response header: buflen=%zu, datalen=%zu", + "HTTP Upgrade response header: buflen=%d, datalen=%zu", H2_BUFSIZE, nread); return CURLE_HTTP2; } @@ -2301,7 +2300,7 @@ CURLcode Curl_http2_stream_pause(struct Curl_easy *data, bool pause) return CURLE_OK; #ifdef NGHTTP2_HAS_SET_LOCAL_WINDOW_SIZE else { - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; struct http_conn *httpc = &data->conn->proto.httpc; uint32_t window = !pause * HTTP2_HUGE_WINDOW_SIZE; int rv = nghttp2_session_set_local_window_size(httpc->h2, diff --git a/libs/libcurl/src/http2.h b/libs/libcurl/src/http2.h index e82b212809..43a6863abe 100644 --- a/libs/libcurl/src/http2.h +++ b/libs/libcurl/src/http2.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/http_chunks.c b/libs/libcurl/src/http_chunks.c index 767f806c81..498481475c 100644 --- a/libs/libcurl/src/http_chunks.c +++ b/libs/libcurl/src/http_chunks.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/http_chunks.h b/libs/libcurl/src/http_chunks.h index 8f4a33c8e4..c8f072a2de 100644 --- a/libs/libcurl/src/http_chunks.h +++ b/libs/libcurl/src/http_chunks.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/http_digest.c b/libs/libcurl/src/http_digest.c index b06dc0d825..dfa40dcb61 100644 --- a/libs/libcurl/src/http_digest.c +++ b/libs/libcurl/src/http_digest.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/http_digest.h b/libs/libcurl/src/http_digest.h index 96e39a7dcc..f7001edec1 100644 --- a/libs/libcurl/src/http_digest.h +++ b/libs/libcurl/src/http_digest.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/http_negotiate.c b/libs/libcurl/src/http_negotiate.c index 0a19ec2afa..872d172fc6 100644 --- a/libs/libcurl/src/http_negotiate.c +++ b/libs/libcurl/src/http_negotiate.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/http_negotiate.h b/libs/libcurl/src/http_negotiate.h index a737f6f781..cf1d007dce 100644 --- a/libs/libcurl/src/http_negotiate.h +++ b/libs/libcurl/src/http_negotiate.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/http_ntlm.c b/libs/libcurl/src/http_ntlm.c index cab543c757..91e1d1f714 100644 --- a/libs/libcurl/src/http_ntlm.c +++ b/libs/libcurl/src/http_ntlm.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/http_ntlm.h b/libs/libcurl/src/http_ntlm.h index 3ebdf979e4..5ddf538727 100644 --- a/libs/libcurl/src/http_ntlm.h +++ b/libs/libcurl/src/http_ntlm.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/http_proxy.c b/libs/libcurl/src/http_proxy.c index 7c34d20648..4242251219 100644 --- a/libs/libcurl/src/http_proxy.c +++ b/libs/libcurl/src/http_proxy.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -102,9 +102,9 @@ CURLcode Curl_proxy_connect(struct connectdata *conn, int sockindex) * This function might be called several times in the multi interface case * if the proxy's CONNECT response is not instant. */ - prot_save = conn->data->req.protop; + prot_save = conn->data->req.p.http; memset(&http_proxy, 0, sizeof(http_proxy)); - conn->data->req.protop = &http_proxy; + conn->data->req.p.http = &http_proxy; connkeep(conn, "HTTP proxy CONNECT"); /* for the secondary socket (FTP), use the "connect to host" @@ -125,7 +125,7 @@ CURLcode Curl_proxy_connect(struct connectdata *conn, int sockindex) else remote_port = conn->remote_port; result = Curl_proxyCONNECT(conn, sockindex, hostname, remote_port); - conn->data->req.protop = prot_save; + conn->data->req.p.http = prot_save; if(CURLE_OK != result) return result; Curl_safefree(data->state.aptr.proxyuserpwd); @@ -167,7 +167,7 @@ static CURLcode connect_init(struct connectdata *conn, bool reinit) Curl_dyn_reset(&s->rcvbuf); } s->tunnel_state = TUNNEL_INIT; - s->keepon = TRUE; + s->keepon = KEEPON_CONNECT; s->cl = 0; s->close_connection = FALSE; return CURLE_OK; @@ -339,7 +339,7 @@ static CURLcode CONNECT(struct connectdata *conn, return CURLE_ABORTED_BY_CALLBACK; if(result) { - s->keepon = FALSE; + s->keepon = KEEPON_DONE; break; } else if(gotbytes <= 0) { @@ -353,11 +353,11 @@ static CURLcode CONNECT(struct connectdata *conn, error = SELECT_ERROR; failf(data, "Proxy CONNECT aborted"); } - s->keepon = FALSE; + s->keepon = KEEPON_DONE; break; } - if(s->keepon > TRUE) { + if(s->keepon == KEEPON_IGNORE) { /* This means we are currently ignoring a response-body */ if(s->cl) { @@ -365,7 +365,7 @@ static CURLcode CONNECT(struct connectdata *conn, and make sure to break out of the loop when we're done! */ s->cl--; if(s->cl <= 0) { - s->keepon = FALSE; + s->keepon = KEEPON_DONE; s->tunnel_state = TUNNEL_COMPLETE; break; } @@ -383,7 +383,7 @@ static CURLcode CONNECT(struct connectdata *conn, if(r == CHUNKE_STOP) { /* we're done reading chunks! */ infof(data, "chunk reading DONE\n"); - s->keepon = FALSE; + s->keepon = KEEPON_DONE; /* we did the full CONNECT treatment, go COMPLETE */ s->tunnel_state = TUNNEL_COMPLETE; } @@ -410,8 +410,7 @@ static CURLcode CONNECT(struct connectdata *conn, return result; /* output debug if that is requested */ - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, linep, perline); + Curl_debug(data, CURLINFO_HEADER_IN, linep, perline); if(!data->set.suppress_connect_headers) { /* send the header to the callback */ @@ -438,7 +437,7 @@ static CURLcode CONNECT(struct connectdata *conn, /* If we get a 407 response code with content length when we have no auth problem, we must ignore the whole response-body */ - s->keepon = 2; + s->keepon = KEEPON_IGNORE; if(s->cl) { infof(data, "Ignore %" CURL_FORMAT_CURL_OFF_T @@ -466,7 +465,7 @@ static CURLcode CONNECT(struct connectdata *conn, if(r == CHUNKE_STOP) { /* we're done reading chunks! */ infof(data, "chunk reading DONE\n"); - s->keepon = FALSE; + s->keepon = KEEPON_DONE; /* we did the full CONNECT treatment, go to COMPLETE */ s->tunnel_state = TUNNEL_COMPLETE; } @@ -475,11 +474,11 @@ static CURLcode CONNECT(struct connectdata *conn, /* without content-length or chunked encoding, we can't keep the connection alive since the close is the end signal so we bail out at once instead */ - s->keepon = FALSE; + s->keepon = KEEPON_DONE; } } else - s->keepon = FALSE; + s->keepon = KEEPON_DONE; if(!s->cl) /* we did the full CONNECT treatment, go to COMPLETE */ s->tunnel_state = TUNNEL_COMPLETE; diff --git a/libs/libcurl/src/http_proxy.h b/libs/libcurl/src/http_proxy.h index 29988a6963..a595e8b553 100644 --- a/libs/libcurl/src/http_proxy.h +++ b/libs/libcurl/src/http_proxy.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/idn_win32.c b/libs/libcurl/src/idn_win32.c index 2f5850dd06..1d475a4eff 100644 --- a/libs/libcurl/src/idn_win32.c +++ b/libs/libcurl/src/idn_win32.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/if2ip.c b/libs/libcurl/src/if2ip.c index 39388692ef..21e00b1f16 100644 --- a/libs/libcurl/src/if2ip.c +++ b/libs/libcurl/src/if2ip.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/if2ip.h b/libs/libcurl/src/if2ip.h index f193d42573..e074e476dc 100644 --- a/libs/libcurl/src/if2ip.h +++ b/libs/libcurl/src/if2ip.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/imap.c b/libs/libcurl/src/imap.c index 46367be103..c6dd7a2323 100644 --- a/libs/libcurl/src/imap.c +++ b/libs/libcurl/src/imap.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -246,7 +246,7 @@ static bool imap_matchresp(const char *line, size_t len, const char *cmd) static bool imap_endofresp(struct connectdata *conn, char *line, size_t len, int *resp) { - struct IMAP *imap = conn->data->req.protop; + struct IMAP *imap = conn->data->req.p.imap; struct imap_conn *imapc = &conn->proto.imapc; const char *id = imapc->resptag; size_t id_len = strlen(id); @@ -607,7 +607,7 @@ static CURLcode imap_perform_list(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct IMAP *imap = data->req.protop; + struct IMAP *imap = data->req.p.imap; if(imap->custom) /* Send the custom request */ @@ -642,7 +642,7 @@ static CURLcode imap_perform_select(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct IMAP *imap = data->req.protop; + struct IMAP *imap = data->req.p.imap; struct imap_conn *imapc = &conn->proto.imapc; char *mailbox; @@ -681,7 +681,7 @@ static CURLcode imap_perform_select(struct connectdata *conn) static CURLcode imap_perform_fetch(struct connectdata *conn) { CURLcode result = CURLE_OK; - struct IMAP *imap = conn->data->req.protop; + struct IMAP *imap = conn->data->req.p.imap; /* Check we have a UID */ if(imap->uid) { @@ -729,7 +729,7 @@ static CURLcode imap_perform_append(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct IMAP *imap = data->req.protop; + struct IMAP *imap = data->req.p.imap; char *mailbox; /* Check we have a mailbox */ @@ -799,7 +799,7 @@ static CURLcode imap_perform_append(struct connectdata *conn) static CURLcode imap_perform_search(struct connectdata *conn) { CURLcode result = CURLE_OK; - struct IMAP *imap = conn->data->req.protop; + struct IMAP *imap = conn->data->req.p.imap; /* Check we have a query string */ if(!imap->query) { @@ -1053,7 +1053,7 @@ static CURLcode imap_state_select_resp(struct connectdata *conn, int imapcode, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct IMAP *imap = conn->data->req.protop; + struct IMAP *imap = conn->data->req.p.imap; struct imap_conn *imapc = &conn->proto.imapc; const char *line = data->state.buffer; @@ -1385,7 +1385,7 @@ static CURLcode imap_init(struct connectdata *conn) struct Curl_easy *data = conn->data; struct IMAP *imap; - imap = data->req.protop = calloc(sizeof(struct IMAP), 1); + imap = data->req.p.imap = calloc(sizeof(struct IMAP), 1); if(!imap) result = CURLE_OUT_OF_MEMORY; @@ -1464,7 +1464,7 @@ static CURLcode imap_done(struct connectdata *conn, CURLcode status, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct IMAP *imap = data->req.protop; + struct IMAP *imap = data->req.p.imap; (void)premature; @@ -1524,7 +1524,7 @@ static CURLcode imap_perform(struct connectdata *conn, bool *connected, /* This is IMAP and no proxy */ CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct IMAP *imap = data->req.protop; + struct IMAP *imap = data->req.p.imap; struct imap_conn *imapc = &conn->proto.imapc; bool selected = FALSE; @@ -1648,7 +1648,7 @@ static CURLcode imap_disconnect(struct connectdata *conn, bool dead_connection) /* Call this when the DO phase has completed */ static CURLcode imap_dophase_done(struct connectdata *conn, bool connected) { - struct IMAP *imap = conn->data->req.protop; + struct IMAP *imap = conn->data->req.p.imap; (void)connected; @@ -1945,7 +1945,7 @@ static CURLcode imap_parse_url_path(struct connectdata *conn) /* The imap struct is already initialised in imap_connect() */ CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct IMAP *imap = data->req.protop; + struct IMAP *imap = data->req.p.imap; const char *begin = &data->state.up.path[1]; /* skip leading slash */ const char *ptr = begin; @@ -2077,7 +2077,7 @@ static CURLcode imap_parse_custom_request(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct IMAP *imap = data->req.protop; + struct IMAP *imap = data->req.p.imap; const char *custom = data->set.str[STRING_CUSTOMREQUEST]; if(custom) { diff --git a/libs/libcurl/src/imap.h b/libs/libcurl/src/imap.h index 8f373d2843..ef6515d8c2 100644 --- a/libs/libcurl/src/imap.h +++ b/libs/libcurl/src/imap.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/inet_ntop.h b/libs/libcurl/src/inet_ntop.h index 9d3f237f37..067632aaee 100644 --- a/libs/libcurl/src/inet_ntop.h +++ b/libs/libcurl/src/inet_ntop.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/inet_pton.h b/libs/libcurl/src/inet_pton.h index e695af9c66..ec1237309f 100644 --- a/libs/libcurl/src/inet_pton.h +++ b/libs/libcurl/src/inet_pton.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/krb5.c b/libs/libcurl/src/krb5.c index ad6daeaa9e..66394f4f30 100644 --- a/libs/libcurl/src/krb5.c +++ b/libs/libcurl/src/krb5.c @@ -99,8 +99,7 @@ static CURLcode ftpsend(struct connectdata *conn, const char *cmd) if(result) break; - if(conn->data->set.verbose) - Curl_debug(conn->data, CURLINFO_HEADER_OUT, sptr, (size_t)bytes_written); + Curl_debug(conn->data, CURLINFO_HEADER_OUT, sptr, (size_t)bytes_written); if(bytes_written != (ssize_t)write_len) { write_len -= bytes_written; @@ -716,7 +715,7 @@ int Curl_sec_read_msg(struct connectdata *conn, char *buffer, return -1; } - if(conn->data->set.verbose) { + { buf[decoded_len] = '\n'; Curl_debug(conn->data, CURLINFO_HEADER_IN, buf, decoded_len + 1); } diff --git a/libs/libcurl/src/ldap.c b/libs/libcurl/src/ldap.c index 8d1ee6445c..0a1f02d5b4 100644 --- a/libs/libcurl/src/ldap.c +++ b/libs/libcurl/src/ldap.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -923,7 +923,7 @@ static int _ldap_url_parse2(const struct connectdata *conn, LDAPURLDesc *ludp) char *unescaped; CURLcode result; - LDAP_TRACE(("attr[%d] '%s'\n", i, attributes[i])); + LDAP_TRACE(("attr[%zu] '%s'\n", i, attributes[i])); /* Unescape the attribute */ result = Curl_urldecode(conn->data, attributes[i], 0, &unescaped, NULL, diff --git a/libs/libcurl/src/libcurl.plist b/libs/libcurl/src/libcurl.plist index eab1efe31c..cf5efc840a 100644 --- a/libs/libcurl/src/libcurl.plist +++ b/libs/libcurl/src/libcurl.plist @@ -12,10 +12,10 @@ <string>curl</string> <key>CFBundleIdentifier</key> - <string>se.haxx.curl.libcurl</string> + <string>se.curl.libcurl</string> <key>CFBundleVersion</key> - <string>7.73.0</string> + <string>7.74.0</string> <key>CFBundleName</key> <string>libcurl</string> @@ -27,9 +27,9 @@ <string>????</string> <key>CFBundleShortVersionString</key> - <string>libcurl 7.73.0</string> + <string>libcurl 7.74.0</string> <key>CFBundleGetInfoString</key> - <string>libcurl.plist 7.73.0</string> + <string>libcurl.plist 7.74.0</string> </dict> </plist> diff --git a/libs/libcurl/src/libcurl.rc b/libs/libcurl/src/libcurl.rc index 4839d0a651..3f7ae16034 100644 --- a/libs/libcurl/src/libcurl.rc +++ b/libs/libcurl/src/libcurl.rc @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -44,7 +44,7 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "CompanyName", "The curl library, https://curl.haxx.se/\0" + VALUE "CompanyName", "The curl library, https://curl.se/\0" VALUE "FileDescription", "libcurl Shared Library\0" VALUE "FileVersion", LIBCURL_VERSION "\0" VALUE "InternalName", "libcurl\0" @@ -52,7 +52,7 @@ BEGIN VALUE "ProductName", "The curl library\0" VALUE "ProductVersion", LIBCURL_VERSION "\0" VALUE "LegalCopyright", "\xa9 " LIBCURL_COPYRIGHT "\0" /* a9: Copyright symbol */ - VALUE "License", "https://curl.haxx.se/docs/copyright.html\0" + VALUE "License", "https://curl.se/docs/copyright.html\0" END END diff --git a/libs/libcurl/src/llist.c b/libs/libcurl/src/llist.c index 0a2baa08ec..17a7be1667 100644 --- a/libs/libcurl/src/llist.c +++ b/libs/libcurl/src/llist.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/llist.h b/libs/libcurl/src/llist.h index 91cfda1bcd..ceae2dd1b7 100644 --- a/libs/libcurl/src/llist.h +++ b/libs/libcurl/src/llist.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/makefile.amiga b/libs/libcurl/src/makefile.amiga index 29df65438c..698a8f4deb 100644 --- a/libs/libcurl/src/makefile.amiga +++ b/libs/libcurl/src/makefile.amiga @@ -9,7 +9,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/makefile.dj b/libs/libcurl/src/makefile.dj index 6ea79e4beb..2b18ad6d54 100644 --- a/libs/libcurl/src/makefile.dj +++ b/libs/libcurl/src/makefile.dj @@ -10,7 +10,7 @@ # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms -# are also available at https://curl.haxx.se/docs/copyright.html. +# are also available at https://curl.se/docs/copyright.html. # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/md4.c b/libs/libcurl/src/md4.c index 67119cda5d..8ae6ac3fab 100644 --- a/libs/libcurl/src/md4.c +++ b/libs/libcurl/src/md4.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/md5.c b/libs/libcurl/src/md5.c index d21625f6ba..513ffb2fb7 100644 --- a/libs/libcurl/src/md5.c +++ b/libs/libcurl/src/md5.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/memdebug.c b/libs/libcurl/src/memdebug.c index 6c56084742..881ee85c32 100644 --- a/libs/libcurl/src/memdebug.c +++ b/libs/libcurl/src/memdebug.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/memdebug.h b/libs/libcurl/src/memdebug.h index 4edafdfb5c..8e88cea580 100644 --- a/libs/libcurl/src/memdebug.h +++ b/libs/libcurl/src/memdebug.h @@ -12,7 +12,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/mime.c b/libs/libcurl/src/mime.c index 6a9b64a2da..2ddd9b8b98 100644 --- a/libs/libcurl/src/mime.c +++ b/libs/libcurl/src/mime.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/mime.h b/libs/libcurl/src/mime.h index 50b7ea6b06..ab89d52517 100644 --- a/libs/libcurl/src/mime.h +++ b/libs/libcurl/src/mime.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/mk-ca-bundle.pl b/libs/libcurl/src/mk-ca-bundle.pl index b9c7ed2579..5ed53fe0d4 100644 --- a/libs/libcurl/src/mk-ca-bundle.pl +++ b/libs/libcurl/src/mk-ca-bundle.pl @@ -10,7 +10,7 @@ # * # * This software is licensed as described in the file COPYING, which # * you should have received as part of this distribution. The terms -# * are also available at https://curl.haxx.se/docs/copyright.html. +# * are also available at https://curl.se/docs/copyright.html. # * # * You may opt to use, copy, modify, merge, publish, distribute and/or sell # * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/mk-ca-bundle.vbs b/libs/libcurl/src/mk-ca-bundle.vbs index 43812f34b7..c6e6f4ffe1 100644 --- a/libs/libcurl/src/mk-ca-bundle.vbs +++ b/libs/libcurl/src/mk-ca-bundle.vbs @@ -9,7 +9,7 @@ '* '* This software is licensed as described in the file COPYING, which '* you should have received as part of this distribution. The terms -'* are also available at https://curl.haxx.se/docs/copyright.html. +'* are also available at https://curl.se/docs/copyright.html. '* '* You may opt to use, copy, modify, merge, publish, distribute and/or sell '* copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/mprintf.c b/libs/libcurl/src/mprintf.c index 6aceadc96f..c681248dee 100644 --- a/libs/libcurl/src/mprintf.c +++ b/libs/libcurl/src/mprintf.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/mqtt.c b/libs/libcurl/src/mqtt.c index c0e9a2b754..e324ec3dd7 100644 --- a/libs/libcurl/src/mqtt.c +++ b/libs/libcurl/src/mqtt.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -96,12 +96,12 @@ static CURLcode mqtt_setup_conn(struct connectdata *conn) during this request */ struct MQTT *mq; struct Curl_easy *data = conn->data; - DEBUGASSERT(data->req.protop == NULL); + DEBUGASSERT(data->req.p.mqtt == NULL); mq = calloc(1, sizeof(struct MQTT)); if(!mq) return CURLE_OUT_OF_MEMORY; - data->req.protop = mq; + data->req.p.mqtt = mq; return CURLE_OK; } @@ -111,10 +111,10 @@ static CURLcode mqtt_send(struct connectdata *conn, CURLcode result = CURLE_OK; curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; struct Curl_easy *data = conn->data; - struct MQTT *mq = data->req.protop; + struct MQTT *mq = data->req.p.mqtt; ssize_t n; result = Curl_write(conn, sockfd, buf, len, &n); - if(!result && data->set.verbose) + if(!result) Curl_debug(data, CURLINFO_HEADER_OUT, buf, (size_t)n); if(len != (size_t)n) { size_t nsend = len - n; @@ -185,8 +185,7 @@ static CURLcode mqtt_verify_connack(struct connectdata *conn) if(result) goto fail; - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, (char *)readbuf, (size_t)nread); + Curl_debug(data, CURLINFO_HEADER_IN, (char *)readbuf, (size_t)nread); /* fixme */ if(nread < MQTT_CONNACK_LEN) { @@ -298,8 +297,7 @@ static CURLcode mqtt_verify_suback(struct connectdata *conn) if(result) goto fail; - if(conn->data->set.verbose) - Curl_debug(conn->data, CURLINFO_HEADER_IN, (char *)readbuf, (size_t)nread); + Curl_debug(conn->data, CURLINFO_HEADER_IN, (char *)readbuf, (size_t)nread); /* fixme */ if(nread < MQTT_SUBACK_LEN) { @@ -427,7 +425,7 @@ static CURLcode mqtt_read_publish(struct connectdata *conn, unsigned char *pkt = (unsigned char *)data->state.buffer; size_t remlen; struct mqtt_conn *mqtt = &conn->proto.mqtt; - struct MQTT *mq = data->req.protop; + struct MQTT *mq = data->req.p.mqtt; unsigned char packet; switch(mqtt->state) { @@ -486,8 +484,7 @@ static CURLcode mqtt_read_publish(struct connectdata *conn, result = CURLE_PARTIAL_FILE; goto end; } - if(data->set.verbose) - Curl_debug(data, CURLINFO_DATA_IN, (char *)pkt, (size_t)nread); + Curl_debug(data, CURLINFO_DATA_IN, (char *)pkt, (size_t)nread); mq->npacket -= nread; k->bytecount += nread; @@ -534,7 +531,7 @@ static CURLcode mqtt_doing(struct connectdata *conn, bool *done) CURLcode result = CURLE_OK; struct mqtt_conn *mqtt = &conn->proto.mqtt; struct Curl_easy *data = conn->data; - struct MQTT *mq = data->req.protop; + struct MQTT *mq = data->req.p.mqtt; ssize_t nread; curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; unsigned char *pkt = (unsigned char *)data->state.buffer; @@ -558,8 +555,7 @@ static CURLcode mqtt_doing(struct connectdata *conn, bool *done) result = Curl_read(conn, sockfd, (char *)&mq->firstbyte, 1, &nread); if(result) break; - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, (char *)&mq->firstbyte, 1); + Curl_debug(data, CURLINFO_HEADER_IN, (char *)&mq->firstbyte, 1); /* remember the first byte */ mq->npacket = 0; mqstate(conn, MQTT_REMAINING_LENGTH, MQTT_NOSTATE); @@ -569,8 +565,7 @@ static CURLcode mqtt_doing(struct connectdata *conn, bool *done) result = Curl_read(conn, sockfd, (char *)&byte, 1, &nread); if(result) break; - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, (char *)&byte, 1); + Curl_debug(data, CURLINFO_HEADER_IN, (char *)&byte, 1); pkt[mq->npacket++] = byte; } while((byte & 0x80) && (mq->npacket < 4)); if(result) diff --git a/libs/libcurl/src/mqtt.h b/libs/libcurl/src/mqtt.h index 37c0441358..fb52c72326 100644 --- a/libs/libcurl/src/mqtt.h +++ b/libs/libcurl/src/mqtt.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/multi.c b/libs/libcurl/src/multi.c index 4cc7c5ae61..86e36be4ac 100644 --- a/libs/libcurl/src/multi.c +++ b/libs/libcurl/src/multi.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -374,11 +374,6 @@ struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */ multi->max_concurrent_streams = 100; multi->ipv6_works = Curl_ipv6works(NULL); -#ifdef USE_WINSOCK - multi->wsa_event = WSACreateEvent(); - if(multi->wsa_event == WSA_INVALID_EVENT) - goto error; -#else #ifdef ENABLE_WAKEUP if(Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, multi->wakeup_pair) < 0) { multi->wakeup_pair[0] = CURL_SOCKET_BAD; @@ -392,7 +387,6 @@ struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */ multi->wakeup_pair[1] = CURL_SOCKET_BAD; } #endif -#endif return multi; @@ -1089,15 +1083,9 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi, unsigned int curlfds; long timeout_internal; int retcode = 0; -#ifndef USE_WINSOCK struct pollfd a_few_on_stack[NUM_POLLS_ON_STACK]; struct pollfd *ufds = &a_few_on_stack[0]; bool ufds_malloc = FALSE; -#else - struct pollfd pre_poll; - WSANETWORKEVENTS wsa_events; - DEBUGASSERT(multi->wsa_event != WSA_INVALID_EVENT); -#endif if(!GOOD_MULTI_HANDLE(multi)) return CURLM_BAD_HANDLE; @@ -1143,16 +1131,11 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi, nfds += extra_nfds; /* add the externally provided ones */ #ifdef ENABLE_WAKEUP -#ifdef USE_WINSOCK - if(use_wakeup) { -#else if(use_wakeup && multi->wakeup_pair[0] != CURL_SOCKET_BAD) { -#endif ++nfds; } #endif -#ifndef USE_WINSOCK if(nfds > NUM_POLLS_ON_STACK) { /* 'nfds' is a 32 bit value and 'struct pollfd' is typically 8 bytes big, so at 2^29 sockets this value might wrap. When a process gets @@ -1163,9 +1146,7 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi, return CURLM_OUT_OF_MEMORY; ufds_malloc = TRUE; } - nfds = 0; -#endif /* only do the second loop if we found descriptors in the first stage run above */ @@ -1178,40 +1159,22 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi, for(i = 0; i < MAX_SOCKSPEREASYHANDLE; i++) { curl_socket_t s = CURL_SOCKET_BAD; -#ifdef USE_WINSOCK - long mask = 0; -#endif + if(bitmap & GETSOCK_READSOCK(i)) { -#ifdef USE_WINSOCK - if(timeout_ms && SOCKET_READABLE(sockbunch[i], 0) > 0) - timeout_ms = 0; - mask |= FD_READ|FD_ACCEPT|FD_CLOSE; -#else ufds[nfds].fd = sockbunch[i]; ufds[nfds].events = POLLIN; ++nfds; -#endif s = sockbunch[i]; } if(bitmap & GETSOCK_WRITESOCK(i)) { -#ifdef USE_WINSOCK - if(timeout_ms && SOCKET_WRITABLE(sockbunch[i], 0) > 0) - timeout_ms = 0; - mask |= FD_WRITE|FD_CONNECT|FD_CLOSE; -#else ufds[nfds].fd = sockbunch[i]; ufds[nfds].events = POLLOUT; ++nfds; -#endif s = sockbunch[i]; } if(s == CURL_SOCKET_BAD) { break; } -#ifdef USE_WINSOCK - if(WSAEventSelect(s, multi->wsa_event, mask) != 0) - return CURLM_INTERNAL_ERROR; -#endif } data = data->next; /* check next handle */ @@ -1220,37 +1183,6 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi, /* Add external file descriptions from poll-like struct curl_waitfd */ for(i = 0; i < extra_nfds; i++) { -#ifdef USE_WINSOCK - long mask = 0; - extra_fds[i].revents = 0; - pre_poll.fd = extra_fds[i].fd; - pre_poll.events = 0; - pre_poll.revents = 0; - if(extra_fds[i].events & CURL_WAIT_POLLIN) { - mask |= FD_READ|FD_ACCEPT|FD_CLOSE; - pre_poll.events |= POLLIN; - } - if(extra_fds[i].events & CURL_WAIT_POLLPRI) { - mask |= FD_OOB; - pre_poll.events |= POLLPRI; - } - if(extra_fds[i].events & CURL_WAIT_POLLOUT) { - mask |= FD_WRITE|FD_CONNECT|FD_CLOSE; - pre_poll.events |= POLLOUT; - } - if(Curl_poll(&pre_poll, 1, 0) > 0) { - if(pre_poll.revents & POLLIN) - extra_fds[i].revents |= CURL_WAIT_POLLIN; - if(pre_poll.revents & POLLPRI) - extra_fds[i].revents |= CURL_WAIT_POLLPRI; - if(pre_poll.revents & POLLOUT) - extra_fds[i].revents |= CURL_WAIT_POLLOUT; - if(extra_fds[i].revents) - timeout_ms = 0; - } - if(WSAEventSelect(extra_fds[i].fd, multi->wsa_event, mask) != 0) - return CURLM_INTERNAL_ERROR; -#else ufds[nfds].fd = extra_fds[i].fd; ufds[nfds].events = 0; if(extra_fds[i].events & CURL_WAIT_POLLIN) @@ -1260,57 +1192,26 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi, if(extra_fds[i].events & CURL_WAIT_POLLOUT) ufds[nfds].events |= POLLOUT; ++nfds; -#endif } #ifdef ENABLE_WAKEUP -#ifndef USE_WINSOCK if(use_wakeup && multi->wakeup_pair[0] != CURL_SOCKET_BAD) { ufds[nfds].fd = multi->wakeup_pair[0]; ufds[nfds].events = POLLIN; ++nfds; } #endif -#endif if(nfds) { /* wait... */ -#ifdef USE_WINSOCK - WSAWaitForMultipleEvents(1, &multi->wsa_event, FALSE, timeout_ms, FALSE); -#else int pollrc = Curl_poll(ufds, nfds, timeout_ms); -#endif - -#ifdef USE_WINSOCK - /* With Winsock, we have to run this unconditionally to call - WSAEventSelect(fd, event, 0) on all the sockets */ - { - retcode = 0; -#else if(pollrc > 0) { retcode = pollrc; -#endif /* copy revents results from the poll to the curl_multi_wait poll struct, the bit values of the actual underlying poll() implementation may not be the same as the ones in the public libcurl API! */ for(i = 0; i < extra_nfds; i++) { unsigned short mask = 0; -#ifdef USE_WINSOCK - wsa_events.lNetworkEvents = 0; - mask = extra_fds[i].revents; - if(WSAEnumNetworkEvents(extra_fds[i].fd, multi->wsa_event, - &wsa_events) == 0) { - if(wsa_events.lNetworkEvents & (FD_READ|FD_ACCEPT|FD_CLOSE)) - mask |= CURL_WAIT_POLLIN; - if(wsa_events.lNetworkEvents & (FD_WRITE|FD_CONNECT|FD_CLOSE)) - mask |= CURL_WAIT_POLLOUT; - if(wsa_events.lNetworkEvents & FD_OOB) - mask |= CURL_WAIT_POLLPRI; - if(ret && wsa_events.lNetworkEvents != 0) - retcode++; - } - WSAEventSelect(extra_fds[i].fd, multi->wsa_event, 0); -#else unsigned r = ufds[curlfds + i].revents; if(r & POLLIN) @@ -1319,46 +1220,9 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi, mask |= CURL_WAIT_POLLOUT; if(r & POLLPRI) mask |= CURL_WAIT_POLLPRI; -#endif extra_fds[i].revents = mask; } -#ifdef USE_WINSOCK - /* Count up all our own sockets that had activity, - and remove them from the event. */ - if(curlfds) { - data = multi->easyp; - while(data) { - bitmap = multi_getsock(data, sockbunch); - - for(i = 0; i < MAX_SOCKSPEREASYHANDLE; i++) { - if(bitmap & (GETSOCK_READSOCK(i) | GETSOCK_WRITESOCK(i))) { - wsa_events.lNetworkEvents = 0; - if(WSAEnumNetworkEvents(sockbunch[i], multi->wsa_event, - &wsa_events) == 0) { - if(ret && wsa_events.lNetworkEvents != 0) - retcode++; - } - if(ret && !timeout_ms && wsa_events.lNetworkEvents == 0) { - if((bitmap & GETSOCK_READSOCK(i)) && - SOCKET_READABLE(sockbunch[i], 0) > 0) - retcode++; - else if((bitmap & GETSOCK_WRITESOCK(i)) && - SOCKET_WRITABLE(sockbunch[i], 0) > 0) - retcode++; - } - WSAEventSelect(sockbunch[i], multi->wsa_event, 0); - } - else - break; - } - - data = data->next; - } - } - - WSAResetEvent(multi->wsa_event); -#else #ifdef ENABLE_WAKEUP if(use_wakeup && multi->wakeup_pair[0] != CURL_SOCKET_BAD) { if(ufds[curlfds + extra_nfds].revents & POLLIN) { @@ -1371,8 +1235,10 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi, when there is no more data, breaking the loop. */ nread = sread(multi->wakeup_pair[0], buf, sizeof(buf)); if(nread <= 0) { +#ifndef USE_WINSOCK if(nread < 0 && EINTR == SOCKERRNO) continue; +#endif break; } } @@ -1381,14 +1247,11 @@ static CURLMcode Curl_multi_wait(struct Curl_multi *multi, } } #endif -#endif } } -#ifndef USE_WINSOCK if(ufds_malloc) free(ufds); -#endif if(ret) *ret = retcode; if(!extrawait || nfds) @@ -1443,10 +1306,6 @@ CURLMcode curl_multi_wakeup(struct Curl_multi *multi) return CURLM_BAD_HANDLE; #ifdef ENABLE_WAKEUP -#ifdef USE_WINSOCK - if(WSASetEvent(multi->wsa_event)) - return CURLM_OK; -#else /* the wakeup_pair variable is only written during init and cleanup, making it safe to access from another thread after the init part and before cleanup */ @@ -1480,7 +1339,6 @@ CURLMcode curl_multi_wakeup(struct Curl_multi *multi) } } #endif -#endif return CURLM_WAKEUP_FAILURE; } @@ -2639,14 +2497,10 @@ CURLMcode curl_multi_cleanup(struct Curl_multi *multi) Curl_hash_destroy(&multi->hostcache); Curl_psl_destroy(&multi->psl); -#ifdef USE_WINSOCK - WSACloseEvent(multi->wsa_event); -#else #ifdef ENABLE_WAKEUP sclose(multi->wakeup_pair[0]); sclose(multi->wakeup_pair[1]); #endif -#endif free(multi); return CURLM_OK; @@ -3158,7 +3012,6 @@ CURLMcode curl_multi_socket_action(struct Curl_multi *multi, curl_socket_t s, } CURLMcode curl_multi_socket_all(struct Curl_multi *multi, int *running_handles) - { CURLMcode result; if(multi->in_callback) @@ -3376,9 +3229,8 @@ void Curl_expire(struct Curl_easy *data, timediff_t milli, expire_id id) /* Since this is an updated time, we must remove the previous entry from the splay tree first and then re-add the new value */ - rc = Curl_splayremovebyaddr(multi->timetree, - &data->state.timenode, - &multi->timetree); + rc = Curl_splayremove(multi->timetree, &data->state.timenode, + &multi->timetree); if(rc) infof(data, "Internal error removing splay node = %d\n", rc); } @@ -3424,9 +3276,8 @@ void Curl_expire_clear(struct Curl_easy *data) struct Curl_llist *list = &data->state.timeoutlist; int rc; - rc = Curl_splayremovebyaddr(multi->timetree, - &data->state.timenode, - &multi->timetree); + rc = Curl_splayremove(multi->timetree, &data->state.timenode, + &multi->timetree); if(rc) infof(data, "Internal error clearing splay node = %d\n", rc); diff --git a/libs/libcurl/src/multihandle.h b/libs/libcurl/src/multihandle.h index c70a1ce09a..de4f74069e 100644 --- a/libs/libcurl/src/multihandle.h +++ b/libs/libcurl/src/multihandle.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -138,14 +138,10 @@ struct Curl_multi { previous callback */ unsigned int max_concurrent_streams; -#ifdef USE_WINSOCK - WSAEVENT wsa_event; /* winsock event used for waits */ -#else #ifdef ENABLE_WAKEUP curl_socket_t wakeup_pair[2]; /* socketpair() used for wakeup 0 is used for read, 1 is used for write */ #endif -#endif /* multiplexing wanted */ bool multiplexing; bool recheckstate; /* see Curl_multi_connchanged */ diff --git a/libs/libcurl/src/multiif.h b/libs/libcurl/src/multiif.h index 7d574df924..f0a57d9a6c 100644 --- a/libs/libcurl/src/multiif.h +++ b/libs/libcurl/src/multiif.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/netrc.c b/libs/libcurl/src/netrc.c index 1c9da31993..13610bb070 100644 --- a/libs/libcurl/src/netrc.c +++ b/libs/libcurl/src/netrc.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/netrc.h b/libs/libcurl/src/netrc.h index 7f56c4b4d6..4938a5916a 100644 --- a/libs/libcurl/src/netrc.h +++ b/libs/libcurl/src/netrc.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/non-ascii.c b/libs/libcurl/src/non-ascii.c index a48e67db4a..30c240b637 100644 --- a/libs/libcurl/src/non-ascii.c +++ b/libs/libcurl/src/non-ascii.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/non-ascii.h b/libs/libcurl/src/non-ascii.h index 5fb5771e04..458e8ef091 100644 --- a/libs/libcurl/src/non-ascii.h +++ b/libs/libcurl/src/non-ascii.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/nonblock.c b/libs/libcurl/src/nonblock.c index abeb6598c2..4a7bde504f 100644 --- a/libs/libcurl/src/nonblock.c +++ b/libs/libcurl/src/nonblock.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/nonblock.h b/libs/libcurl/src/nonblock.h index d50d315944..761dab4f6d 100644 --- a/libs/libcurl/src/nonblock.h +++ b/libs/libcurl/src/nonblock.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/nwlib.c b/libs/libcurl/src/nwlib.c index beec0b3889..769326892a 100644 --- a/libs/libcurl/src/nwlib.c +++ b/libs/libcurl/src/nwlib.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/nwos.c b/libs/libcurl/src/nwos.c index c6c22ccbbf..889403132c 100644 --- a/libs/libcurl/src/nwos.c +++ b/libs/libcurl/src/nwos.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/openldap.c b/libs/libcurl/src/openldap.c index 2aff4f6037..24892ff414 100644 --- a/libs/libcurl/src/openldap.c +++ b/libs/libcurl/src/openldap.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -412,7 +412,7 @@ static CURLcode ldap_do(struct connectdata *conn, bool *done) if(!lr) return CURLE_OUT_OF_MEMORY; lr->msgid = msgid; - data->req.protop = lr; + data->req.p.ldap = lr; Curl_setup_transfer(data, FIRSTSOCKET, -1, FALSE, -1); *done = TRUE; return CURLE_OK; @@ -421,7 +421,7 @@ static CURLcode ldap_do(struct connectdata *conn, bool *done) static CURLcode ldap_done(struct connectdata *conn, CURLcode res, bool premature) { - struct ldapreqinfo *lr = conn->data->req.protop; + struct ldapreqinfo *lr = conn->data->req.p.ldap; (void)res; (void)premature; @@ -433,7 +433,7 @@ static CURLcode ldap_done(struct connectdata *conn, CURLcode res, ldap_abandon_ext(li->ld, lr->msgid, NULL, NULL); lr->msgid = 0; } - conn->data->req.protop = NULL; + conn->data->req.p.ldap = NULL; free(lr); } @@ -445,7 +445,7 @@ static ssize_t ldap_recv(struct connectdata *conn, int sockindex, char *buf, { struct ldapconninfo *li = conn->proto.ldapc; struct Curl_easy *data = conn->data; - struct ldapreqinfo *lr = data->req.protop; + struct ldapreqinfo *lr = data->req.p.ldap; int rc, ret; LDAPMessage *msg = NULL; LDAPMessage *ent; diff --git a/libs/libcurl/src/parsedate.c b/libs/libcurl/src/parsedate.c index dd6150b44e..3c38f2c4c2 100644 --- a/libs/libcurl/src/parsedate.c +++ b/libs/libcurl/src/parsedate.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/parsedate.h b/libs/libcurl/src/parsedate.h index 8c7ae94e43..a99faf9e36 100644 --- a/libs/libcurl/src/parsedate.h +++ b/libs/libcurl/src/parsedate.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/pingpong.c b/libs/libcurl/src/pingpong.c index 5a06674ad1..5d6109a7df 100644 --- a/libs/libcurl/src/pingpong.c +++ b/libs/libcurl/src/pingpong.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -218,8 +218,7 @@ CURLcode Curl_pp_vsendf(struct pingpong *pp, conn->data_prot = data_sec; #endif - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_OUT, s, (size_t)bytes_written); + Curl_debug(data, CURLINFO_HEADER_OUT, s, (size_t)bytes_written); if(bytes_written != (ssize_t)write_len) { /* the whole chunk was not sent, keep it around and adjust sizes */ @@ -364,9 +363,8 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd, #ifdef HAVE_GSSAPI if(!conn->sec_complete) #endif - if(data->set.verbose) - Curl_debug(data, CURLINFO_HEADER_IN, - pp->linestart_resp, (size_t)perline); + Curl_debug(data, CURLINFO_HEADER_IN, + pp->linestart_resp, (size_t)perline); /* * We pass all response-lines to the callback function registered diff --git a/libs/libcurl/src/pingpong.h b/libs/libcurl/src/pingpong.h index 855815afd5..0d0c74afa0 100644 --- a/libs/libcurl/src/pingpong.h +++ b/libs/libcurl/src/pingpong.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/pop3.c b/libs/libcurl/src/pop3.c index 5a73545823..e71860e48a 100644 --- a/libs/libcurl/src/pop3.c +++ b/libs/libcurl/src/pop3.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -553,7 +553,7 @@ static CURLcode pop3_perform_command(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct POP3 *pop3 = data->req.protop; + struct POP3 *pop3 = data->req.p.pop3; const char *command = NULL; /* Calculate the default command */ @@ -886,7 +886,7 @@ static CURLcode pop3_state_command_resp(struct connectdata *conn, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct POP3 *pop3 = data->req.protop; + struct POP3 *pop3 = data->req.p.pop3; struct pop3_conn *pop3c = &conn->proto.pop3c; struct pingpong *pp = &pop3c->pp; @@ -1048,7 +1048,7 @@ static CURLcode pop3_init(struct connectdata *conn) struct Curl_easy *data = conn->data; struct POP3 *pop3; - pop3 = data->req.protop = calloc(sizeof(struct POP3), 1); + pop3 = data->req.p.pop3 = calloc(sizeof(struct POP3), 1); if(!pop3) result = CURLE_OUT_OF_MEMORY; @@ -1123,7 +1123,7 @@ static CURLcode pop3_done(struct connectdata *conn, CURLcode status, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct POP3 *pop3 = data->req.protop; + struct POP3 *pop3 = data->req.p.pop3; (void)premature; @@ -1157,7 +1157,7 @@ static CURLcode pop3_perform(struct connectdata *conn, bool *connected, { /* This is POP3 and no proxy */ CURLcode result = CURLE_OK; - struct POP3 *pop3 = conn->data->req.protop; + struct POP3 *pop3 = conn->data->req.p.pop3; DEBUGF(infof(conn->data, "DO phase starts\n")); @@ -1389,7 +1389,7 @@ static CURLcode pop3_parse_url_path(struct connectdata *conn) { /* The POP3 struct is already initialised in pop3_connect() */ struct Curl_easy *data = conn->data; - struct POP3 *pop3 = data->req.protop; + struct POP3 *pop3 = data->req.p.pop3; const char *path = &data->state.up.path[1]; /* skip leading path */ /* URL decode the path for the message ID */ @@ -1406,7 +1406,7 @@ static CURLcode pop3_parse_custom_request(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct POP3 *pop3 = data->req.protop; + struct POP3 *pop3 = data->req.p.pop3; const char *custom = data->set.str[STRING_CUSTOMREQUEST]; /* URL decode the custom request */ diff --git a/libs/libcurl/src/pop3.h b/libs/libcurl/src/pop3.h index 3ba7999771..6ca3fd511f 100644 --- a/libs/libcurl/src/pop3.h +++ b/libs/libcurl/src/pop3.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2009 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2009 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/progress.c b/libs/libcurl/src/progress.c index eced74c9f9..658d05ab8e 100644 --- a/libs/libcurl/src/progress.c +++ b/libs/libcurl/src/progress.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -240,10 +240,8 @@ void Curl_pgrsStartNow(struct Curl_easy *data) data->progress.speeder_c = 0; /* reset the progress meter display */ data->progress.start = Curl_now(); data->progress.is_t_startransfer_set = false; - data->progress.ul_limit_start.tv_sec = 0; - data->progress.ul_limit_start.tv_usec = 0; - data->progress.dl_limit_start.tv_sec = 0; - data->progress.dl_limit_start.tv_usec = 0; + data->progress.ul_limit_start = data->progress.start; + data->progress.dl_limit_start = data->progress.start; data->progress.downloaded = 0; data->progress.uploaded = 0; /* clear all bits except HIDE and HEADERS_OUT */ diff --git a/libs/libcurl/src/progress.h b/libs/libcurl/src/progress.h index c19d966d31..74680099f0 100644 --- a/libs/libcurl/src/progress.h +++ b/libs/libcurl/src/progress.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/psl.c b/libs/libcurl/src/psl.c index 568baff03f..e46091863f 100644 --- a/libs/libcurl/src/psl.c +++ b/libs/libcurl/src/psl.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/psl.h b/libs/libcurl/src/psl.h index e9f99d03ec..c10367471d 100644 --- a/libs/libcurl/src/psl.h +++ b/libs/libcurl/src/psl.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/quic.h b/libs/libcurl/src/quic.h index 8e7df90eac..f04662e820 100644 --- a/libs/libcurl/src/quic.h +++ b/libs/libcurl/src/quic.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -41,7 +41,7 @@ CURLcode Curl_quic_connect(struct connectdata *conn, const struct sockaddr *addr, socklen_t addrlen); CURLcode Curl_quic_is_connected(struct connectdata *conn, - curl_socket_t sockfd, + int sockindex, bool *connected); int Curl_quic_ver(char *p, size_t len); CURLcode Curl_quic_done_sending(struct connectdata *conn); diff --git a/libs/libcurl/src/rand.c b/libs/libcurl/src/rand.c index c415048ec5..951fedb0a9 100644 --- a/libs/libcurl/src/rand.c +++ b/libs/libcurl/src/rand.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/rand.h b/libs/libcurl/src/rand.h index 3c8e2b81dc..02d95d8e64 100644 --- a/libs/libcurl/src/rand.h +++ b/libs/libcurl/src/rand.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/rename.c b/libs/libcurl/src/rename.c index fe5f95d0df..f858d43695 100644 --- a/libs/libcurl/src/rename.c +++ b/libs/libcurl/src/rename.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -24,8 +24,8 @@ #include "curl_setup.h" -#if (!defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)) || \ - defined(USE_ALTSVC) +#if (!defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_COOKIES)) || \ + !defined(CURL_DISABLE_ALTSVC) #include "curl_multibyte.h" #include "timeval.h" diff --git a/libs/libcurl/src/rename.h b/libs/libcurl/src/rename.h index d7442c8447..534f7471c8 100644 --- a/libs/libcurl/src/rename.h +++ b/libs/libcurl/src/rename.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/rtsp.c b/libs/libcurl/src/rtsp.c index 46c3c4f8f4..151ff4af27 100644 --- a/libs/libcurl/src/rtsp.c +++ b/libs/libcurl/src/rtsp.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -115,7 +115,7 @@ static CURLcode rtsp_setup_connection(struct connectdata *conn) { struct RTSP *rtsp; - conn->data->req.protop = rtsp = calloc(1, sizeof(struct RTSP)); + conn->data->req.p.rtsp = rtsp = calloc(1, sizeof(struct RTSP)); if(!rtsp) return CURLE_OUT_OF_MEMORY; @@ -200,7 +200,7 @@ static CURLcode rtsp_done(struct connectdata *conn, CURLcode status, bool premature) { struct Curl_easy *data = conn->data; - struct RTSP *rtsp = data->req.protop; + struct RTSP *rtsp = data->req.p.rtsp; CURLcode httpStatus; /* Bypass HTTP empty-reply checks on receive */ @@ -233,7 +233,7 @@ static CURLcode rtsp_do(struct connectdata *conn, bool *done) struct Curl_easy *data = conn->data; CURLcode result = CURLE_OK; Curl_RtspReq rtspreq = data->set.rtspreq; - struct RTSP *rtsp = data->req.protop; + struct RTSP *rtsp = data->req.p.rtsp; struct dynbuf req_buffer; curl_off_t postsize = 0; /* for ANNOUNCE and SET_PARAMETER */ curl_off_t putsize = 0; /* for ANNOUNCE and SET_PARAMETER */ @@ -765,7 +765,7 @@ CURLcode Curl_rtsp_parseheader(struct connectdata *conn, /* Store the received CSeq. Match is verified in rtsp_done */ int nc = sscanf(&header[4], ": %ld", &CSeq); if(nc == 1) { - struct RTSP *rtsp = data->req.protop; + struct RTSP *rtsp = data->req.p.rtsp; rtsp->CSeq_recv = CSeq; /* mark the request */ data->state.rtsp_CSeq_recv = CSeq; /* update the handle */ } @@ -776,6 +776,8 @@ CURLcode Curl_rtsp_parseheader(struct connectdata *conn, } else if(checkprefix("Session:", header)) { char *start; + char *end; + size_t idlen; /* Find the first non-space letter */ start = header + 8; @@ -784,11 +786,25 @@ CURLcode Curl_rtsp_parseheader(struct connectdata *conn, if(!*start) { failf(data, "Got a blank Session ID"); + return CURLE_RTSP_SESSION_ERROR; } - else if(data->set.str[STRING_RTSP_SESSION_ID]) { + + /* Find the end of Session ID + * + * Allow any non whitespace content, up to the field separator or end of + * line. RFC 2326 isn't 100% clear on the session ID and for example + * gstreamer does url-encoded session ID's not covered by the standard. + */ + end = start; + while(*end && *end != ';' && !ISSPACE(*end)) + end++; + idlen = end - start; + + if(data->set.str[STRING_RTSP_SESSION_ID]) { + /* If the Session ID is set, then compare */ - if(strncmp(start, data->set.str[STRING_RTSP_SESSION_ID], - strlen(data->set.str[STRING_RTSP_SESSION_ID])) != 0) { + if(strlen(data->set.str[STRING_RTSP_SESSION_ID]) != idlen || + strncmp(start, data->set.str[STRING_RTSP_SESSION_ID], idlen) != 0) { failf(data, "Got RTSP Session ID Line [%s], but wanted ID [%s]", start, data->set.str[STRING_RTSP_SESSION_ID]); return CURLE_RTSP_SESSION_ERROR; @@ -797,21 +813,14 @@ CURLcode Curl_rtsp_parseheader(struct connectdata *conn, else { /* If the Session ID is not set, and we find it in a response, then set * it. - * - * Allow any non whitespace content, up to the field separator or end of - * line. RFC 2326 isn't 100% clear on the session ID and for example - * gstreamer does url-encoded session ID's not covered by the standard. */ - char *end = start; - while(*end && *end != ';' && !ISSPACE(*end)) - end++; /* Copy the id substring into a new buffer */ - data->set.str[STRING_RTSP_SESSION_ID] = malloc(end - start + 1); + data->set.str[STRING_RTSP_SESSION_ID] = malloc(idlen + 1); if(data->set.str[STRING_RTSP_SESSION_ID] == NULL) return CURLE_OUT_OF_MEMORY; - memcpy(data->set.str[STRING_RTSP_SESSION_ID], start, end - start); - (data->set.str[STRING_RTSP_SESSION_ID])[end - start] = '\0'; + memcpy(data->set.str[STRING_RTSP_SESSION_ID], start, idlen); + (data->set.str[STRING_RTSP_SESSION_ID])[idlen] = '\0'; } } return CURLE_OK; diff --git a/libs/libcurl/src/rtsp.h b/libs/libcurl/src/rtsp.h index 1aae86456d..bf7f0bc8ef 100644 --- a/libs/libcurl/src/rtsp.h +++ b/libs/libcurl/src/rtsp.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/select.c b/libs/libcurl/src/select.c index 917133b72b..7d1f944cdb 100644 --- a/libs/libcurl/src/select.c +++ b/libs/libcurl/src/select.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/select.h b/libs/libcurl/src/select.h index c9cc5c2e81..1350950439 100644 --- a/libs/libcurl/src/select.h +++ b/libs/libcurl/src/select.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/sendf.c b/libs/libcurl/src/sendf.c index 6cfc89b694..04cc725f5a 100644 --- a/libs/libcurl/src/sendf.c +++ b/libs/libcurl/src/sendf.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -28,6 +28,8 @@ #ifdef HAVE_LINUX_TCP_H #include <linux/tcp.h> +#elif defined(HAVE_NETINET_TCP_H) +#include <netinet/tcp.h> #endif #include <curl/curl.h> @@ -277,11 +279,8 @@ void Curl_failf(struct Curl_easy *data, const char *fmt, ...) strcpy(data->set.errorbuffer, error); data->state.errorbuf = TRUE; /* wrote error string */ } - if(data->set.verbose) { - error[len] = '\n'; - error[++len] = '\0'; - Curl_debug(data, CURLINFO_TEXT, error, len); - } + error[len++] = '\n'; + Curl_debug(data, CURLINFO_TEXT, error, len); va_end(ap); } } @@ -693,72 +692,74 @@ CURLcode Curl_read(struct connectdata *conn, /* connection data */ int Curl_debug(struct Curl_easy *data, curl_infotype type, char *ptr, size_t size) { - static const char s_infotype[CURLINFO_END][3] = { - "* ", "< ", "> ", "{ ", "} ", "{ ", "} " }; int rc = 0; + if(data->set.verbose) { + static const char s_infotype[CURLINFO_END][3] = { + "* ", "< ", "> ", "{ ", "} ", "{ ", "} " }; #ifdef CURL_DOES_CONVERSIONS - char *buf = NULL; - size_t conv_size = 0; - - switch(type) { - case CURLINFO_HEADER_OUT: - buf = Curl_memdup(ptr, size); - if(!buf) - return 1; - conv_size = size; - - /* Special processing is needed for this block if it - * contains both headers and data (separated by CRLFCRLF). - * We want to convert just the headers, leaving the data as-is. - */ - if(size > 4) { - size_t i; - for(i = 0; i < size-4; i++) { - if(memcmp(&buf[i], "\x0d\x0a\x0d\x0a", 4) == 0) { - /* convert everything through this CRLFCRLF but no further */ - conv_size = i + 4; - break; + char *buf = NULL; + size_t conv_size = 0; + + switch(type) { + case CURLINFO_HEADER_OUT: + buf = Curl_memdup(ptr, size); + if(!buf) + return 1; + conv_size = size; + + /* Special processing is needed for this block if it + * contains both headers and data (separated by CRLFCRLF). + * We want to convert just the headers, leaving the data as-is. + */ + if(size > 4) { + size_t i; + for(i = 0; i < size-4; i++) { + if(memcmp(&buf[i], "\x0d\x0a\x0d\x0a", 4) == 0) { + /* convert everything through this CRLFCRLF but no further */ + conv_size = i + 4; + break; + } } } - } - Curl_convert_from_network(data, buf, conv_size); - /* Curl_convert_from_network calls failf if unsuccessful */ - /* we might as well continue even if it fails... */ - ptr = buf; /* switch pointer to use my buffer instead */ - break; - default: - /* leave everything else as-is */ - break; - } + Curl_convert_from_network(data, buf, conv_size); + /* Curl_convert_from_network calls failf if unsuccessful */ + /* we might as well continue even if it fails... */ + ptr = buf; /* switch pointer to use my buffer instead */ + break; + default: + /* leave everything else as-is */ + break; + } #endif /* CURL_DOES_CONVERSIONS */ - if(data->set.fdebug) { - Curl_set_in_callback(data, true); - rc = (*data->set.fdebug)(data, type, ptr, size, data->set.debugdata); - Curl_set_in_callback(data, false); - } - else { - switch(type) { - case CURLINFO_TEXT: - case CURLINFO_HEADER_OUT: - case CURLINFO_HEADER_IN: - fwrite(s_infotype[type], 2, 1, data->set.err); - fwrite(ptr, size, 1, data->set.err); + if(data->set.fdebug) { + Curl_set_in_callback(data, true); + rc = (*data->set.fdebug)(data, type, ptr, size, data->set.debugdata); + Curl_set_in_callback(data, false); + } + else { + switch(type) { + case CURLINFO_TEXT: + case CURLINFO_HEADER_OUT: + case CURLINFO_HEADER_IN: + fwrite(s_infotype[type], 2, 1, data->set.err); + fwrite(ptr, size, 1, data->set.err); #ifdef CURL_DOES_CONVERSIONS - if(size != conv_size) { - /* we had untranslated data so we need an explicit newline */ - fwrite("\n", 1, 1, data->set.err); - } + if(size != conv_size) { + /* we had untranslated data so we need an explicit newline */ + fwrite("\n", 1, 1, data->set.err); + } #endif - break; - default: /* nada */ - break; + break; + default: /* nada */ + break; + } } - } #ifdef CURL_DOES_CONVERSIONS - free(buf); + free(buf); #endif + } return rc; } diff --git a/libs/libcurl/src/sendf.h b/libs/libcurl/src/sendf.h index 2e270c598b..c7e67c7451 100644 --- a/libs/libcurl/src/sendf.h +++ b/libs/libcurl/src/sendf.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/setopt.c b/libs/libcurl/src/setopt.c index fa53982158..58956c1e95 100644 --- a/libs/libcurl/src/setopt.c +++ b/libs/libcurl/src/setopt.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -30,6 +30,8 @@ #ifdef HAVE_LINUX_TCP_H #include <linux/tcp.h> +#elif defined(HAVE_NETINET_TCP_H) +#include <netinet/tcp.h> #endif #include "urldata.h" @@ -45,6 +47,7 @@ #include "setopt.h" #include "multiif.h" #include "altsvc.h" +#include "hsts.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" @@ -2839,7 +2842,46 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) data->set.trailer_data = va_arg(param, void *); #endif break; -#ifdef USE_ALTSVC +#ifdef USE_HSTS + case CURLOPT_HSTSREADFUNCTION: + data->set.hsts_read = va_arg(param, curl_hstsread_callback); + break; + case CURLOPT_HSTSREADDATA: + data->set.hsts_read_userp = va_arg(param, void *); + break; + case CURLOPT_HSTSWRITEFUNCTION: + data->set.hsts_write = va_arg(param, curl_hstswrite_callback); + break; + case CURLOPT_HSTSWRITEDATA: + data->set.hsts_write_userp = va_arg(param, void *); + break; + case CURLOPT_HSTS: + if(!data->hsts) { + data->hsts = Curl_hsts_init(); + if(!data->hsts) + return CURLE_OUT_OF_MEMORY; + } + argptr = va_arg(param, char *); + result = Curl_setstropt(&data->set.str[STRING_HSTS], argptr); + if(result) + return result; + if(argptr) + (void)Curl_hsts_loadfile(data, data->hsts, argptr); + break; + case CURLOPT_HSTS_CTRL: + arg = va_arg(param, long); + if(arg & CURLHSTS_ENABLE) { + if(!data->hsts) { + data->hsts = Curl_hsts_init(); + if(!data->hsts) + return CURLE_OUT_OF_MEMORY; + } + } + else + Curl_hsts_cleanup(&data->hsts); + break; +#endif +#ifndef CURL_DISABLE_ALTSVC case CURLOPT_ALTSVC: if(!data->asi) { data->asi = Curl_altsvc_init(); diff --git a/libs/libcurl/src/setopt.h b/libs/libcurl/src/setopt.h index 5fc4368dc9..affbfd9960 100644 --- a/libs/libcurl/src/setopt.h +++ b/libs/libcurl/src/setopt.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/setup-os400.h b/libs/libcurl/src/setup-os400.h index b693cb3b37..8c97371e4d 100644 --- a/libs/libcurl/src/setup-os400.h +++ b/libs/libcurl/src/setup-os400.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/setup-vms.h b/libs/libcurl/src/setup-vms.h index 0e39c9f6b6..ba75dc295b 100644 --- a/libs/libcurl/src/setup-vms.h +++ b/libs/libcurl/src/setup-vms.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/setup-win32.h b/libs/libcurl/src/setup-win32.h index d20662aa19..c35dec88cb 100644 --- a/libs/libcurl/src/setup-win32.h +++ b/libs/libcurl/src/setup-win32.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/sha256.c b/libs/libcurl/src/sha256.c index ee5d273c43..910d7ae1e8 100644 --- a/libs/libcurl/src/sha256.c +++ b/libs/libcurl/src/sha256.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/share.c b/libs/libcurl/src/share.c index 407ac34536..5ce9830335 100644 --- a/libs/libcurl/src/share.c +++ b/libs/libcurl/src/share.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/share.h b/libs/libcurl/src/share.h index aa964b6ccd..01aa9cda59 100644 --- a/libs/libcurl/src/share.h +++ b/libs/libcurl/src/share.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/sigpipe.h b/libs/libcurl/src/sigpipe.h index 3960a139db..430cfc6489 100644 --- a/libs/libcurl/src/sigpipe.h +++ b/libs/libcurl/src/sigpipe.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/slist.c b/libs/libcurl/src/slist.c index d27fbe19bc..907c203f38 100644 --- a/libs/libcurl/src/slist.c +++ b/libs/libcurl/src/slist.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/slist.h b/libs/libcurl/src/slist.h index 799b3c060f..3114259cfe 100644 --- a/libs/libcurl/src/slist.h +++ b/libs/libcurl/src/slist.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/smb.c b/libs/libcurl/src/smb.c index 41d97b84cc..dd914a05bf 100644 --- a/libs/libcurl/src/smb.c +++ b/libs/libcurl/src/smb.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -204,7 +204,7 @@ static void conn_state(struct connectdata *conn, enum smb_conn_state newstate) static void request_state(struct connectdata *conn, enum smb_req_state newstate) { - struct smb_request *req = conn->data->req.protop; + struct smb_request *req = conn->data->req.p.smb; #if defined(DEBUGBUILD) && !defined(CURL_DISABLE_VERBOSE_STRINGS) /* For debug purposes */ static const char * const names[] = { @@ -234,7 +234,7 @@ static CURLcode smb_setup_connection(struct connectdata *conn) struct smb_request *req; /* Initialize the request state */ - conn->data->req.protop = req = calloc(1, sizeof(struct smb_request)); + conn->data->req.p.smb = req = calloc(1, sizeof(struct smb_request)); if(!req) return CURLE_OUT_OF_MEMORY; @@ -342,7 +342,7 @@ static void smb_format_message(struct connectdata *conn, struct smb_header *h, unsigned char cmd, size_t len) { struct smb_conn *smbc = &conn->proto.smbc; - struct smb_request *req = conn->data->req.protop; + struct smb_request *req = conn->data->req.p.smb; unsigned int pid; memset(h, 0, sizeof(*h)); @@ -505,7 +505,7 @@ static CURLcode smb_send_tree_connect(struct connectdata *conn) static CURLcode smb_send_open(struct connectdata *conn) { - struct smb_request *req = conn->data->req.protop; + struct smb_request *req = conn->data->req.p.smb; struct smb_nt_create msg; size_t byte_count; @@ -535,7 +535,7 @@ static CURLcode smb_send_open(struct connectdata *conn) static CURLcode smb_send_close(struct connectdata *conn) { - struct smb_request *req = conn->data->req.protop; + struct smb_request *req = conn->data->req.p.smb; struct smb_close msg; memset(&msg, 0, sizeof(msg)); @@ -556,7 +556,7 @@ static CURLcode smb_send_tree_disconnect(struct connectdata *conn) static CURLcode smb_send_read(struct connectdata *conn) { - struct smb_request *req = conn->data->req.protop; + struct smb_request *req = conn->data->req.p.smb; curl_off_t offset = conn->data->req.offset; struct smb_read msg; @@ -575,7 +575,7 @@ static CURLcode smb_send_read(struct connectdata *conn) static CURLcode smb_send_write(struct connectdata *conn) { struct smb_write *msg; - struct smb_request *req = conn->data->req.protop; + struct smb_request *req = conn->data->req.p.smb; curl_off_t offset = conn->data->req.offset; curl_off_t upload_size = conn->data->req.size - conn->data->req.bytecount; CURLcode result = Curl_get_upload_buffer(conn->data); @@ -738,7 +738,7 @@ static void get_posix_time(time_t *out, curl_off_t timestamp) static CURLcode smb_request_state(struct connectdata *conn, bool *done) { - struct smb_request *req = conn->data->req.protop; + struct smb_request *req = conn->data->req.p.smb; struct smb_header *h; struct smb_conn *smbc = &conn->proto.smbc; enum smb_req_state next_state = SMB_DONE; @@ -923,7 +923,7 @@ static CURLcode smb_done(struct connectdata *conn, CURLcode status, bool premature) { (void) premature; - Curl_safefree(conn->data->req.protop); + Curl_safefree(conn->data->req.p.smb); return status; } @@ -957,7 +957,7 @@ static CURLcode smb_do(struct connectdata *conn, bool *done) static CURLcode smb_parse_url_path(struct connectdata *conn) { struct Curl_easy *data = conn->data; - struct smb_request *req = data->req.protop; + struct smb_request *req = data->req.p.smb; struct smb_conn *smbc = &conn->proto.smbc; char *path; char *slash; diff --git a/libs/libcurl/src/smb.h b/libs/libcurl/src/smb.h index ff0a354b7b..907cf0c8e2 100644 --- a/libs/libcurl/src/smb.h +++ b/libs/libcurl/src/smb.h @@ -12,7 +12,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/smtp.c b/libs/libcurl/src/smtp.c index 49743c0369..509d802f1c 100644 --- a/libs/libcurl/src/smtp.c +++ b/libs/libcurl/src/smtp.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -486,7 +486,7 @@ static CURLcode smtp_perform_command(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SMTP *smtp = data->req.protop; + struct SMTP *smtp = data->req.p.smtp; if(smtp->rcpt) { /* We notify the server we are sending UTF-8 data if a) it supports the @@ -699,7 +699,7 @@ static CURLcode smtp_perform_mail(struct connectdata *conn) any there do, as we need to correctly identify our support for SMTPUTF8 in the envelope, as per RFC-6531 sect. 3.4 */ if(conn->proto.smtpc.utf8_supported && !utf8) { - struct SMTP *smtp = data->req.protop; + struct SMTP *smtp = data->req.p.smtp; struct curl_slist *rcpt = smtp->rcpt; while(rcpt && !utf8) { @@ -743,7 +743,7 @@ static CURLcode smtp_perform_rcpt_to(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SMTP *smtp = data->req.protop; + struct SMTP *smtp = data->req.p.smtp; char *address = NULL; struct hostname host = { NULL, NULL, NULL, NULL }; @@ -991,7 +991,7 @@ static CURLcode smtp_state_command_resp(struct connectdata *conn, int smtpcode, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SMTP *smtp = data->req.protop; + struct SMTP *smtp = data->req.p.smtp; char *line = data->state.buffer; size_t len = strlen(line); @@ -1057,7 +1057,7 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SMTP *smtp = data->req.protop; + struct SMTP *smtp = data->req.p.smtp; bool is_smtp_err = FALSE; bool is_smtp_blocking_err = FALSE; @@ -1280,7 +1280,7 @@ static CURLcode smtp_init(struct connectdata *conn) struct Curl_easy *data = conn->data; struct SMTP *smtp; - smtp = data->req.protop = calloc(sizeof(struct SMTP), 1); + smtp = data->req.p.smtp = calloc(sizeof(struct SMTP), 1); if(!smtp) result = CURLE_OUT_OF_MEMORY; @@ -1359,7 +1359,7 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status, { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SMTP *smtp = data->req.protop; + struct SMTP *smtp = data->req.p.smtp; struct pingpong *pp = &conn->proto.smtpc.pp; char *eob; ssize_t len; @@ -1445,7 +1445,7 @@ static CURLcode smtp_perform(struct connectdata *conn, bool *connected, /* This is SMTP and no proxy */ CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SMTP *smtp = data->req.protop; + struct SMTP *smtp = data->req.p.smtp; DEBUGF(infof(conn->data, "DO phase starts\n")); @@ -1553,7 +1553,7 @@ static CURLcode smtp_disconnect(struct connectdata *conn, bool dead_connection) /* Call this when the DO phase has completed */ static CURLcode smtp_dophase_done(struct connectdata *conn, bool connected) { - struct SMTP *smtp = conn->data->req.protop; + struct SMTP *smtp = conn->data->req.p.smtp; (void)connected; @@ -1706,7 +1706,7 @@ static CURLcode smtp_parse_custom_request(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SMTP *smtp = data->req.protop; + struct SMTP *smtp = data->req.p.smtp; const char *custom = data->set.str[STRING_CUSTOMREQUEST]; /* URL decode the custom request */ @@ -1799,7 +1799,7 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, const ssize_t nread) ssize_t i; ssize_t si; struct Curl_easy *data = conn->data; - struct SMTP *smtp = data->req.protop; + struct SMTP *smtp = data->req.p.smtp; char *scratch = data->state.scratch; char *newscratch = NULL; char *oldscratch = NULL; diff --git a/libs/libcurl/src/smtp.h b/libs/libcurl/src/smtp.h index 164a175d75..c7c62ee857 100644 --- a/libs/libcurl/src/smtp.h +++ b/libs/libcurl/src/smtp.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/sockaddr.h b/libs/libcurl/src/sockaddr.h index b037ee06c2..84c08d9bb5 100644 --- a/libs/libcurl/src/sockaddr.h +++ b/libs/libcurl/src/sockaddr.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/socketpair.c b/libs/libcurl/src/socketpair.c index 9e1f9ef4c1..2c580ad2de 100644 --- a/libs/libcurl/src/socketpair.c +++ b/libs/libcurl/src/socketpair.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/socketpair.h b/libs/libcurl/src/socketpair.h index be9fb24f97..033a235aa2 100644 --- a/libs/libcurl/src/socketpair.h +++ b/libs/libcurl/src/socketpair.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2019 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/socks.c b/libs/libcurl/src/socks.c index a41b67d5a9..a2d1e621f9 100644 --- a/libs/libcurl/src/socks.c +++ b/libs/libcurl/src/socks.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -771,7 +771,7 @@ CURLproxycode Curl_SOCKS5(const char *proxy_user, case CONNECT_RESOLVING: /* check if we have the name resolved by now */ - dns = Curl_fetch_addr(conn, hostname, (int)conn->port); + dns = Curl_fetch_addr(conn, hostname, remote_port); if(dns) { #ifdef CURLRES_ASYNCH diff --git a/libs/libcurl/src/socks.h b/libs/libcurl/src/socks.h index 17e6f46101..1fae58b6fa 100644 --- a/libs/libcurl/src/socks.h +++ b/libs/libcurl/src/socks.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/socks_gssapi.c b/libs/libcurl/src/socks_gssapi.c index 2e36b9940a..a96579692b 100644 --- a/libs/libcurl/src/socks_gssapi.c +++ b/libs/libcurl/src/socks_gssapi.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -493,7 +493,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex, gss_release_buffer(&gss_status, &gss_recv_token); if(gss_w_token.length != 1) { - failf(data, "Invalid GSS-API encryption response length (%d).", + failf(data, "Invalid GSS-API encryption response length (%zu).", gss_w_token.length); gss_release_buffer(&gss_status, &gss_w_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); @@ -505,7 +505,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex, } else { if(gss_recv_token.length != 1) { - failf(data, "Invalid GSS-API encryption response length (%d).", + failf(data, "Invalid GSS-API encryption response length (%zu).", gss_recv_token.length); gss_release_buffer(&gss_status, &gss_recv_token); gss_delete_sec_context(&gss_status, &gss_context, NULL); diff --git a/libs/libcurl/src/socks_sspi.c b/libs/libcurl/src/socks_sspi.c index 2f1fd36fa4..b9ac2ade8e 100644 --- a/libs/libcurl/src/socks_sspi.c +++ b/libs/libcurl/src/socks_sspi.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/speedcheck.c b/libs/libcurl/src/speedcheck.c index 3aeea9111b..2665a44c55 100644 --- a/libs/libcurl/src/speedcheck.c +++ b/libs/libcurl/src/speedcheck.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/speedcheck.h b/libs/libcurl/src/speedcheck.h index 5c2dc9a226..1d4c7bfeff 100644 --- a/libs/libcurl/src/speedcheck.h +++ b/libs/libcurl/src/speedcheck.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/splay.c b/libs/libcurl/src/splay.c index 0f5fcd1e8f..98baf5d871 100644 --- a/libs/libcurl/src/splay.c +++ b/libs/libcurl/src/splay.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1997 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1997 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -206,9 +206,9 @@ struct Curl_tree *Curl_splaygetbest(struct curltime i, * * @unittest: 1309 */ -int Curl_splayremovebyaddr(struct Curl_tree *t, - struct Curl_tree *removenode, - struct Curl_tree **newroot) +int Curl_splayremove(struct Curl_tree *t, + struct Curl_tree *removenode, + struct Curl_tree **newroot) { static const struct curltime KEY_NOTUSED = { (time_t)-1, (unsigned int)-1 diff --git a/libs/libcurl/src/splay.h b/libs/libcurl/src/splay.h index 9292f349b5..eb9f65f1e0 100644 --- a/libs/libcurl/src/splay.h +++ b/libs/libcurl/src/splay.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1997 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1997 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -40,19 +40,13 @@ struct Curl_tree *Curl_splayinsert(struct curltime key, struct Curl_tree *t, struct Curl_tree *newnode); -#if 0 -struct Curl_tree *Curl_splayremove(struct curltime key, - struct Curl_tree *t, - struct Curl_tree **removed); -#endif - struct Curl_tree *Curl_splaygetbest(struct curltime key, struct Curl_tree *t, struct Curl_tree **removed); -int Curl_splayremovebyaddr(struct Curl_tree *t, - struct Curl_tree *removenode, - struct Curl_tree **newroot); +int Curl_splayremove(struct Curl_tree *t, + struct Curl_tree *removenode, + struct Curl_tree **newroot); #define Curl_splaycomparekeys(i,j) ( ((i.tv_sec) < (j.tv_sec)) ? -1 : \ ( ((i.tv_sec) > (j.tv_sec)) ? 1 : \ diff --git a/libs/libcurl/src/strcase.c b/libs/libcurl/src/strcase.c index a309e35291..955e3c79ea 100644 --- a/libs/libcurl/src/strcase.c +++ b/libs/libcurl/src/strcase.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/strcase.h b/libs/libcurl/src/strcase.h index cd4c4191a9..10dc698817 100644 --- a/libs/libcurl/src/strcase.h +++ b/libs/libcurl/src/strcase.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/strdup.c b/libs/libcurl/src/strdup.c index 7732802b07..9af47ea473 100644 --- a/libs/libcurl/src/strdup.c +++ b/libs/libcurl/src/strdup.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/strdup.h b/libs/libcurl/src/strdup.h index ae3d5d0115..0936956f89 100644 --- a/libs/libcurl/src/strdup.h +++ b/libs/libcurl/src/strdup.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/strerror.c b/libs/libcurl/src/strerror.c index b5808df2d1..9b2fc26c2f 100644 --- a/libs/libcurl/src/strerror.c +++ b/libs/libcurl/src/strerror.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -781,7 +781,7 @@ const char *Curl_strerror(int err, char *buf, size_t buflen) } #else { - char *msg = strerror(err); + const char *msg = strerror(err); if(msg) strncpy(buf, msg, max); else diff --git a/libs/libcurl/src/strerror.h b/libs/libcurl/src/strerror.h index bae8f89745..96a7e27c51 100644 --- a/libs/libcurl/src/strerror.h +++ b/libs/libcurl/src/strerror.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/strtok.c b/libs/libcurl/src/strtok.c index ba6e0258a6..d53e587ab3 100644 --- a/libs/libcurl/src/strtok.c +++ b/libs/libcurl/src/strtok.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/strtok.h b/libs/libcurl/src/strtok.h index e221fa680f..831ef0c009 100644 --- a/libs/libcurl/src/strtok.h +++ b/libs/libcurl/src/strtok.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/strtoofft.c b/libs/libcurl/src/strtoofft.c index 96e3820600..ac87cfc5bd 100644 --- a/libs/libcurl/src/strtoofft.c +++ b/libs/libcurl/src/strtoofft.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/strtoofft.h b/libs/libcurl/src/strtoofft.h index be19cd716b..4d22ba36c9 100644 --- a/libs/libcurl/src/strtoofft.h +++ b/libs/libcurl/src/strtoofft.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/system_win32.c b/libs/libcurl/src/system_win32.c index 9b0797bf9f..b377da7d8b 100644 --- a/libs/libcurl/src/system_win32.c +++ b/libs/libcurl/src/system_win32.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/system_win32.h b/libs/libcurl/src/system_win32.h index 2547bda952..69e0c812c0 100644 --- a/libs/libcurl/src/system_win32.h +++ b/libs/libcurl/src/system_win32.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/telnet.c b/libs/libcurl/src/telnet.c index 754febe27b..8bf64a9f2b 100644 --- a/libs/libcurl/src/telnet.c +++ b/libs/libcurl/src/telnet.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -202,7 +202,7 @@ CURLcode init_telnet(struct connectdata *conn) if(!tn) return CURLE_OUT_OF_MEMORY; - conn->data->req.protop = tn; /* make us known */ + conn->data->req.p.telnet = tn; /* make us known */ tn->telrcv_state = CURL_TS_DATA; @@ -247,7 +247,7 @@ CURLcode init_telnet(struct connectdata *conn) static void negotiate(struct connectdata *conn) { int i; - struct TELNET *tn = (struct TELNET *) conn->data->req.protop; + struct TELNET *tn = (struct TELNET *) conn->data->req.p.telnet; for(i = 0; i < CURL_NTELOPTS; i++) { if(i == CURL_TELOPT_ECHO) @@ -320,7 +320,7 @@ static void send_negotiation(struct connectdata *conn, int cmd, int option) static void set_remote_option(struct connectdata *conn, int option, int newstate) { - struct TELNET *tn = (struct TELNET *)conn->data->req.protop; + struct TELNET *tn = (struct TELNET *)conn->data->req.p.telnet; if(newstate == CURL_YES) { switch(tn->him[option]) { case CURL_NO: @@ -394,7 +394,7 @@ void set_remote_option(struct connectdata *conn, int option, int newstate) static void rec_will(struct connectdata *conn, int option) { - struct TELNET *tn = (struct TELNET *)conn->data->req.protop; + struct TELNET *tn = (struct TELNET *)conn->data->req.p.telnet; switch(tn->him[option]) { case CURL_NO: if(tn->him_preferred[option] == CURL_YES) { @@ -442,7 +442,7 @@ void rec_will(struct connectdata *conn, int option) static void rec_wont(struct connectdata *conn, int option) { - struct TELNET *tn = (struct TELNET *)conn->data->req.protop; + struct TELNET *tn = (struct TELNET *)conn->data->req.p.telnet; switch(tn->him[option]) { case CURL_NO: /* Already disabled */ @@ -484,7 +484,7 @@ void rec_wont(struct connectdata *conn, int option) static void set_local_option(struct connectdata *conn, int option, int newstate) { - struct TELNET *tn = (struct TELNET *)conn->data->req.protop; + struct TELNET *tn = (struct TELNET *)conn->data->req.p.telnet; if(newstate == CURL_YES) { switch(tn->us[option]) { case CURL_NO: @@ -558,7 +558,7 @@ set_local_option(struct connectdata *conn, int option, int newstate) static void rec_do(struct connectdata *conn, int option) { - struct TELNET *tn = (struct TELNET *)conn->data->req.protop; + struct TELNET *tn = (struct TELNET *)conn->data->req.p.telnet; switch(tn->us[option]) { case CURL_NO: if(tn->us_preferred[option] == CURL_YES) { @@ -618,7 +618,7 @@ void rec_do(struct connectdata *conn, int option) static void rec_dont(struct connectdata *conn, int option) { - struct TELNET *tn = (struct TELNET *)conn->data->req.protop; + struct TELNET *tn = (struct TELNET *)conn->data->req.p.telnet; switch(tn->us[option]) { case CURL_NO: /* Already disabled */ @@ -777,7 +777,7 @@ static CURLcode check_telnet_options(struct connectdata *conn) char option_keyword[128] = ""; char option_arg[256] = ""; struct Curl_easy *data = conn->data; - struct TELNET *tn = (struct TELNET *)conn->data->req.protop; + struct TELNET *tn = (struct TELNET *)conn->data->req.p.telnet; CURLcode result = CURLE_OK; int binary_option; @@ -884,7 +884,7 @@ static void suboption(struct connectdata *conn) char varname[128] = ""; char varval[128] = ""; struct Curl_easy *data = conn->data; - struct TELNET *tn = (struct TELNET *)data->req.protop; + struct TELNET *tn = (struct TELNET *)data->req.p.telnet; printsub(data, '<', (unsigned char *)tn->subbuffer, CURL_SB_LEN(tn) + 2); switch(CURL_SB_GET(tn)) { @@ -959,7 +959,7 @@ static void sendsuboption(struct connectdata *conn, int option) unsigned char *uc1, *uc2; struct Curl_easy *data = conn->data; - struct TELNET *tn = (struct TELNET *)data->req.protop; + struct TELNET *tn = (struct TELNET *)data->req.p.telnet; switch(option) { case CURL_TELOPT_NAWS: @@ -1017,7 +1017,7 @@ CURLcode telrcv(struct connectdata *conn, int in = 0; int startwrite = -1; struct Curl_easy *data = conn->data; - struct TELNET *tn = (struct TELNET *)data->req.protop; + struct TELNET *tn = (struct TELNET *)data->req.p.telnet; #define startskipping() \ if(startwrite >= 0) { \ @@ -1235,7 +1235,7 @@ static CURLcode send_telnet_data(struct connectdata *conn, static CURLcode telnet_done(struct connectdata *conn, CURLcode status, bool premature) { - struct TELNET *tn = (struct TELNET *)conn->data->req.protop; + struct TELNET *tn = (struct TELNET *)conn->data->req.p.telnet; (void)status; /* unused */ (void)premature; /* not used */ @@ -1245,7 +1245,7 @@ static CURLcode telnet_done(struct connectdata *conn, curl_slist_free_all(tn->telnet_vars); tn->telnet_vars = NULL; - Curl_safefree(conn->data->req.protop); + Curl_safefree(conn->data->req.p.telnet); return CURLE_OK; } @@ -1283,7 +1283,7 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done) if(result) return result; - tn = (struct TELNET *)data->req.protop; + tn = data->req.p.telnet; result = check_telnet_options(conn); if(result) diff --git a/libs/libcurl/src/telnet.h b/libs/libcurl/src/telnet.h index 431427f395..1427473a9f 100644 --- a/libs/libcurl/src/telnet.h +++ b/libs/libcurl/src/telnet.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/tftp.c b/libs/libcurl/src/tftp.c index 1d3b8e8255..fba3f5e8c2 100644 --- a/libs/libcurl/src/tftp.c +++ b/libs/libcurl/src/tftp.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/tftp.h b/libs/libcurl/src/tftp.h index 33348300fe..4b5bea2757 100644 --- a/libs/libcurl/src/tftp.h +++ b/libs/libcurl/src/tftp.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/timeval.c b/libs/libcurl/src/timeval.c index e761966a1b..8523dad400 100644 --- a/libs/libcurl/src/timeval.c +++ b/libs/libcurl/src/timeval.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/timeval.h b/libs/libcurl/src/timeval.h index 53e063607c..685e72961d 100644 --- a/libs/libcurl/src/timeval.h +++ b/libs/libcurl/src/timeval.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/transfer.c b/libs/libcurl/src/transfer.c index a07c7af8ce..bfd0218fef 100644 --- a/libs/libcurl/src/transfer.c +++ b/libs/libcurl/src/transfer.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -78,6 +78,7 @@ #include "mime.h" #include "strcase.h" #include "urlapi-int.h" +#include "hsts.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" @@ -167,7 +168,7 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, size_t bytes, bool sending_http_headers = FALSE; if(conn->handler->protocol&(PROTO_FAMILY_HTTP|CURLPROTO_RTSP)) { - const struct HTTP *http = data->req.protop; + const struct HTTP *http = data->req.p.http; if(http->sending == HTTPSEND_REQUEST) /* We're sending the HTTP request headers, not the data. @@ -426,7 +427,7 @@ CURLcode Curl_readrewind(struct connectdata *conn) CURLOPT_HTTPPOST, call app to rewind */ if(conn->handler->protocol & PROTO_FAMILY_HTTP) { - struct HTTP *http = data->req.protop; + struct HTTP *http = data->req.p.http; if(http->sendit) mimepart = http->sendit; @@ -1028,7 +1029,7 @@ static CURLcode readwrite_upload(struct Curl_easy *data, /* HTTP pollution, this should be written nicer to become more protocol agnostic. */ size_t fillcount; - struct HTTP *http = k->protop; + struct HTTP *http = k->p.http; if((k->exp100 == EXP100_SENDING_REQUEST) && (http->sending == HTTPSEND_BODY)) { @@ -1152,10 +1153,9 @@ static CURLcode readwrite_upload(struct Curl_easy *data, win_update_buffer_size(conn->writesockfd); - if(data->set.verbose) - /* show the data before we change the pointer upload_fromhere */ - Curl_debug(data, CURLINFO_DATA_OUT, k->upload_fromhere, - (size_t)bytes_written); + /* show the data before we change the pointer upload_fromhere */ + Curl_debug(data, CURLINFO_DATA_OUT, k->upload_fromhere, + (size_t)bytes_written); k->writebytecount += bytes_written; Curl_pgrsSetUploadCounter(data, k->writebytecount); @@ -1529,6 +1529,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data) } #endif Curl_http2_init_state(&data->state); + Curl_hsts_loadcb(data, data->hsts); } return result; @@ -1853,7 +1854,7 @@ Curl_setup_transfer( { struct SingleRequest *k = &data->req; struct connectdata *conn = data->conn; - struct HTTP *http = data->req.protop; + struct HTTP *http = data->req.p.http; bool httpsending = ((conn->handler->protocol&PROTO_FAMILY_HTTP) && (http->sending == HTTPSEND_REQUEST)); DEBUGASSERT(conn != NULL); diff --git a/libs/libcurl/src/transfer.h b/libs/libcurl/src/transfer.h index 67fd91f25b..178bb58fb0 100644 --- a/libs/libcurl/src/transfer.h +++ b/libs/libcurl/src/transfer.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/url.c b/libs/libcurl/src/url.c index 8af33c0403..2b0ba87ba8 100644 --- a/libs/libcurl/src/url.c +++ b/libs/libcurl/src/url.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -96,6 +96,7 @@ bool curl_win32_idn_to_ascii(const char *in, char **out); #include "getinfo.h" #include "urlapi-int.h" #include "system_win32.h" +#include "hsts.h" /* And now for the protocols */ #include "ftp.h" @@ -411,6 +412,8 @@ CURLcode Curl_close(struct Curl_easy **datap) Curl_flush_cookies(data, TRUE); Curl_altsvc_save(data, data->asi, data->set.str[STRING_ALTSVC]); Curl_altsvc_cleanup(&data->asi); + Curl_hsts_save(data, data->hsts, data->set.str[STRING_HSTS]); + Curl_hsts_cleanup(&data->hsts); #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_CRYPTO_AUTH) Curl_http_auth_cleanup_digest(data); #endif @@ -494,6 +497,7 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data) set->ftp_use_eprt = TRUE; /* FTP defaults to EPRT operations */ set->ftp_use_pret = FALSE; /* mainly useful for drftpd servers */ set->ftp_filemethod = FTPFILE_MULTICWD; + set->ftp_skip_ip = TRUE; /* skip PASV IP by default */ #endif set->dns_cache_timeout = 60; /* Timeout every 60 seconds by default */ @@ -1911,6 +1915,37 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, if(uc) return Curl_uc_to_curlcode(uc); + uc = curl_url_get(uh, CURLUPART_HOST, &data->state.up.hostname, 0); + if(uc) { + if(!strcasecompare("file", data->state.up.scheme)) + return CURLE_OUT_OF_MEMORY; + } + +#ifdef USE_HSTS + if(data->hsts && strcasecompare("http", data->state.up.scheme)) { + if(Curl_hsts(data->hsts, data->state.up.hostname, TRUE)) { + char *url; + Curl_safefree(data->state.up.scheme); + uc = curl_url_set(uh, CURLUPART_SCHEME, "https", 0); + if(uc) + return Curl_uc_to_curlcode(uc); + if(data->change.url_alloc) + Curl_safefree(data->change.url); + /* after update, get the updated version */ + uc = curl_url_get(uh, CURLUPART_URL, &url, 0); + if(uc) + return Curl_uc_to_curlcode(uc); + uc = curl_url_get(uh, CURLUPART_SCHEME, &data->state.up.scheme, 0); + if(uc) + return Curl_uc_to_curlcode(uc); + data->change.url = url; + data->change.url_alloc = TRUE; + infof(data, "Switched from HTTP to HTTPS due to HSTS => %s\n", + data->change.url); + } + } +#endif + result = findprotocol(data, conn, data->state.up.scheme); if(result) return result; @@ -1956,12 +1991,6 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, else if(uc != CURLUE_NO_OPTIONS) return Curl_uc_to_curlcode(uc); - uc = curl_url_get(uh, CURLUPART_HOST, &data->state.up.hostname, 0); - if(uc) { - if(!strcasecompare("file", data->state.up.scheme)) - return CURLE_OUT_OF_MEMORY; - } - uc = curl_url_get(uh, CURLUPART_PATH, &data->state.up.path, 0); if(uc) return Curl_uc_to_curlcode(uc); @@ -2080,7 +2109,7 @@ static CURLcode setup_connection_internals(struct connectdata *conn) void Curl_free_request_state(struct Curl_easy *data) { - Curl_safefree(data->req.protop); + Curl_safefree(data->req.p.http); Curl_safefree(data->req.newurl); #ifndef CURL_DISABLE_DOH @@ -3095,7 +3124,7 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data, conn_to_host = conn_to_host->next; } -#ifdef USE_ALTSVC +#ifndef CURL_DISABLE_ALTSVC if(data->asi && !host && (port == -1) && ((conn->handler->protocol == CURLPROTO_HTTPS) || #ifdef CURLDEBUG diff --git a/libs/libcurl/src/url.h b/libs/libcurl/src/url.h index 1941dc6a4f..a9d5bda29c 100644 --- a/libs/libcurl/src/url.h +++ b/libs/libcurl/src/url.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/urlapi-int.h b/libs/libcurl/src/urlapi-int.h index d14d53d97a..4257233094 100644 --- a/libs/libcurl/src/urlapi-int.h +++ b/libs/libcurl/src/urlapi-int.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -28,7 +28,7 @@ bool Curl_is_absolute_url(const char *url, char *scheme, size_t buflen); #ifdef DEBUGBUILD -CURLUcode Curl_parse_port(struct Curl_URL *u, char *hostname); +CURLUcode Curl_parse_port(struct Curl_URL *u, char *hostname, bool); #endif #endif /* HEADER_CURL_URLAPI_INT_H */ diff --git a/libs/libcurl/src/urlapi.c b/libs/libcurl/src/urlapi.c index 88b7f042f4..ae75963595 100644 --- a/libs/libcurl/src/urlapi.c +++ b/libs/libcurl/src/urlapi.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -497,7 +497,8 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u, return result; } -UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, char *hostname) +UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, char *hostname, + bool has_scheme) { char *portptr = NULL; char endbracket; @@ -542,10 +543,14 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, char *hostname) /* Browser behavior adaptation. If there's a colon with no digits after, just cut off the name there which makes us ignore the colon and just - use the default port. Firefox, Chrome and Safari all do that. */ + use the default port. Firefox, Chrome and Safari all do that. + + Don't do it if the URL has no scheme, to make something that looks like + a scheme not work! + */ if(!portptr[1]) { *portptr = '\0'; - return CURLUE_OK; + return has_scheme ? CURLUE_OK : CURLUE_BAD_PORT_NUMBER; } if(!ISDIGIT(portptr[1])) @@ -904,7 +909,7 @@ static CURLUcode seturl(const char *url, CURLU *u, unsigned int flags) if(result) return result; - result = Curl_parse_port(u, hostname); + result = Curl_parse_port(u, hostname, url_has_scheme); if(result) return result; @@ -1387,28 +1392,17 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, if(urlencode) { const unsigned char *i; char *o; - bool free_part = FALSE; char *enc = malloc(nalloc * 3 + 1); /* for worst case! */ if(!enc) return CURLUE_OUT_OF_MEMORY; - if(plusencode) { - /* space to plus */ - i = (const unsigned char *)part; - for(o = enc; *i; ++o, ++i) - *o = (*i == ' ') ? '+' : *i; - *o = 0; /* null-terminate */ - part = strdup(enc); - if(!part) { - free(enc); - return CURLUE_OUT_OF_MEMORY; - } - free_part = TRUE; - } for(i = (const unsigned char *)part, o = enc; *i; i++) { - if(Curl_isunreserved(*i) || - ((*i == '/') && urlskipslash) || - ((*i == '=') && equalsencode) || - ((*i == '+') && plusencode)) { + if((*i == ' ') && plusencode) { + *o = '+'; + o++; + } + else if(Curl_isunreserved(*i) || + ((*i == '/') && urlskipslash) || + ((*i == '=') && equalsencode)) { if((*i == '=') && equalsencode) /* only skip the first equals sign */ equalsencode = FALSE; @@ -1422,8 +1416,6 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, } *o = 0; /* null-terminate */ newp = enc; - if(free_part) - free((char *)part); } else { char *p; diff --git a/libs/libcurl/src/urldata.h b/libs/libcurl/src/urldata.h index 5ee81770ea..4679c9d463 100644 --- a/libs/libcurl/src/urldata.h +++ b/libs/libcurl/src/urldata.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -205,14 +205,14 @@ struct ssl_backend_data; /* struct for data related to each SSL connection */ struct ssl_connect_data { - /* Use ssl encrypted communications TRUE/FALSE, not necessarily using it atm - but at least asked to or meaning to use it. See 'state' for the exact - current state of the connection. */ ssl_connection_state state; ssl_connect_state connecting_state; #if defined(USE_SSL) struct ssl_backend_data *backend; #endif + /* Use ssl encrypted communications TRUE/FALSE. The library is not + necessarily using ssl at the moment but at least asked to or means to use + it. See 'state' for the exact current state of the connection. */ BIT(use); }; @@ -519,7 +519,7 @@ struct Curl_async { int port; struct Curl_dns_entry *dns; int status; /* if done is TRUE, this is the status from the callback */ - void *os_specific; /* 'struct thread_data' for Windows */ + struct thread_data *tdata; BIT(done); /* set TRUE when the lookup is complete */ }; @@ -643,8 +643,23 @@ struct SingleRequest { and the 'upload_present' contains the number of bytes available at this position */ char *upload_fromhere; - void *protop; /* Allocated protocol-specific data. Each protocol - handler makes sure this points to data it needs. */ + + /* Allocated protocol-specific data. Each protocol handler makes sure this + points to data it needs. */ + union { + struct FILEPROTO *file; + struct FTP *ftp; + struct HTTP *http; + struct IMAP *imap; + struct ldapreqinfo *ldap; + struct MQTT *mqtt; + struct POP3 *pop3; + struct RTSP *rtsp; + struct smb_request *smb; + struct SMTP *smtp; + struct SSHPROTO *ssh; + struct TELNET *telnet; + } p; #ifndef CURL_DISABLE_DOH struct dohdata doh; /* DoH specific data for this request */ #endif @@ -802,7 +817,11 @@ struct proxy_info { /* struct for HTTP CONNECT state data */ struct http_connect_state { struct dynbuf rcvbuf; - int keepon; + enum keeponval { + KEEPON_DONE, + KEEPON_CONNECT, + KEEPON_IGNORE + } keepon; curl_off_t cl; /* size of content to read and ignore */ enum { TUNNEL_INIT, /* init/default/no tunnel state */ @@ -1531,35 +1550,26 @@ enum dupstring { STRING_RTSP_SESSION_ID, /* Session ID to use */ STRING_RTSP_STREAM_URI, /* Stream URI for this request */ STRING_RTSP_TRANSPORT, /* Transport for this session */ - STRING_SSH_PRIVATE_KEY, /* path to the private key file for auth */ STRING_SSH_PUBLIC_KEY, /* path to the public key file for auth */ STRING_SSH_HOST_PUBLIC_KEY_MD5, /* md5 of host public key in ascii hex */ STRING_SSH_KNOWNHOSTS, /* file name of knownhosts file */ - STRING_PROXY_SERVICE_NAME, /* Proxy service name */ STRING_SERVICE_NAME, /* Service name */ STRING_MAIL_FROM, STRING_MAIL_AUTH, - STRING_TLSAUTH_USERNAME_ORIG, /* TLS auth <username> */ STRING_TLSAUTH_USERNAME_PROXY, /* TLS auth <username> */ STRING_TLSAUTH_PASSWORD_ORIG, /* TLS auth <password> */ STRING_TLSAUTH_PASSWORD_PROXY, /* TLS auth <password> */ - STRING_BEARER, /* <bearer>, if used */ - STRING_UNIX_SOCKET_PATH, /* path to Unix socket, if used */ - STRING_TARGET, /* CURLOPT_REQUEST_TARGET */ STRING_DOH, /* CURLOPT_DOH_URL */ - STRING_ALTSVC, /* CURLOPT_ALTSVC */ - + STRING_HSTS, /* CURLOPT_HSTS */ STRING_SASL_AUTHZID, /* CURLOPT_SASL_AUTHZID */ - STRING_TEMP_URL, /* temp URL storage for proxy use */ - STRING_DNS_SERVERS, STRING_DNS_INTERFACE, STRING_DNS_LOCAL_IP4, @@ -1648,7 +1658,12 @@ struct UserDefined { curl_conv_callback convtonetwork; /* function to convert from UTF-8 encoding: */ curl_conv_callback convfromutf8; - +#ifdef USE_HSTS + curl_hstsread_callback hsts_read; + void *hsts_read_userp; + curl_hstswrite_callback hsts_write; + void *hsts_write_userp; +#endif void *progress_client; /* pointer to pass to the progress callback */ void *ioctl_client; /* pointer to pass to the ioctl callback */ long timeout; /* in milliseconds, 0 means no timeout */ @@ -1899,7 +1914,10 @@ struct Curl_easy { NOTE that the 'cookie' field in the UserDefined struct defines if the "engine" is to be used or not. */ -#ifdef USE_ALTSVC +#ifdef USE_HSTS + struct hsts *hsts; +#endif +#ifndef CURL_DISABLE_ALTSVC struct altsvcinfo *asi; /* the alt-svc cache */ #endif struct Progress progress; /* for all the progress meter data */ diff --git a/libs/libcurl/src/vauth/cleartext.c b/libs/libcurl/src/vauth/cleartext.c index 3a5c9430f4..620dba03ef 100644 --- a/libs/libcurl/src/vauth/cleartext.c +++ b/libs/libcurl/src/vauth/cleartext.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/cram.c b/libs/libcurl/src/vauth/cram.c index 717d7f093d..1a376259a8 100644 --- a/libs/libcurl/src/vauth/cram.c +++ b/libs/libcurl/src/vauth/cram.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/digest.c b/libs/libcurl/src/vauth/digest.c index b9210a8fec..5fc9285263 100644 --- a/libs/libcurl/src/vauth/digest.c +++ b/libs/libcurl/src/vauth/digest.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/digest.h b/libs/libcurl/src/vauth/digest.h index cc05fdb769..ee373cd82e 100644 --- a/libs/libcurl/src/vauth/digest.h +++ b/libs/libcurl/src/vauth/digest.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/digest_sspi.c b/libs/libcurl/src/vauth/digest_sspi.c index 4998306ce8..91d18c992b 100644 --- a/libs/libcurl/src/vauth/digest_sspi.c +++ b/libs/libcurl/src/vauth/digest_sspi.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/krb5_gssapi.c b/libs/libcurl/src/vauth/krb5_gssapi.c index 95bab0e2ee..0412815e93 100644 --- a/libs/libcurl/src/vauth/krb5_gssapi.c +++ b/libs/libcurl/src/vauth/krb5_gssapi.c @@ -6,11 +6,11 @@ * \___|\___/|_| \_\_____| * * Copyright (C) 2014 - 2019, Steve Holme, <steve_holme@hotmail.com>. - * Copyright (C) 2015, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2015 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/krb5_sspi.c b/libs/libcurl/src/vauth/krb5_sspi.c index 1fb6257ea9..8e56a82409 100644 --- a/libs/libcurl/src/vauth/krb5_sspi.c +++ b/libs/libcurl/src/vauth/krb5_sspi.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/ntlm.c b/libs/libcurl/src/vauth/ntlm.c index ecfeacb9af..a3117f3fee 100644 --- a/libs/libcurl/src/vauth/ntlm.c +++ b/libs/libcurl/src/vauth/ntlm.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -497,7 +497,6 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, const char *passwdp, struct ntlmdata *ntlm, char **outptr, size_t *outlen) - { /* NTLM type-3 message structure: diff --git a/libs/libcurl/src/vauth/ntlm.h b/libs/libcurl/src/vauth/ntlm.h index 1136b0f8d3..8ec23ad4f5 100644 --- a/libs/libcurl/src/vauth/ntlm.h +++ b/libs/libcurl/src/vauth/ntlm.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/ntlm_sspi.c b/libs/libcurl/src/vauth/ntlm_sspi.c index 84ea51dadb..28bc3efdaa 100644 --- a/libs/libcurl/src/vauth/ntlm_sspi.c +++ b/libs/libcurl/src/vauth/ntlm_sspi.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/oauth2.c b/libs/libcurl/src/vauth/oauth2.c index b4e9f8e704..ca5842a7c0 100644 --- a/libs/libcurl/src/vauth/oauth2.c +++ b/libs/libcurl/src/vauth/oauth2.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/spnego_gssapi.c b/libs/libcurl/src/vauth/spnego_gssapi.c index ed7ce029ec..120925ff33 100644 --- a/libs/libcurl/src/vauth/spnego_gssapi.c +++ b/libs/libcurl/src/vauth/spnego_gssapi.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/spnego_sspi.c b/libs/libcurl/src/vauth/spnego_sspi.c index 194f250f87..e7482a43e2 100644 --- a/libs/libcurl/src/vauth/spnego_sspi.c +++ b/libs/libcurl/src/vauth/spnego_sspi.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/vauth.c b/libs/libcurl/src/vauth/vauth.c index d98e66c68a..129b8f8b57 100644 --- a/libs/libcurl/src/vauth/vauth.c +++ b/libs/libcurl/src/vauth/vauth.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vauth/vauth.h b/libs/libcurl/src/vauth/vauth.h index a1a557d2a1..f25cfc329f 100644 --- a/libs/libcurl/src/vauth/vauth.h +++ b/libs/libcurl/src/vauth/vauth.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2014 - 2019, Steve Holme, <steve_holme@hotmail.com>. + * Copyright (C) 2014 - 2020, Steve Holme, <steve_holme@hotmail.com>. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/version.c b/libs/libcurl/src/version.c index bdeba88357..7064c20d2f 100644 --- a/libs/libcurl/src/version.c +++ b/libs/libcurl/src/version.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -415,9 +415,12 @@ static curl_version_info_data version_info = { #if defined(HAVE_ZSTD) | CURL_VERSION_ZSTD #endif -#if defined(USE_ALTSVC) +#ifndef CURL_DISABLE_ALTSVC | CURL_VERSION_ALTSVC #endif +#if defined(USE_HSTS) + | CURL_VERSION_HSTS +#endif , NULL, /* ssl_version */ 0, /* ssl_version_num, this is kept at zero */ diff --git a/libs/libcurl/src/version_win32.c b/libs/libcurl/src/version_win32.c index 6561d36be8..b8157e9893 100644 --- a/libs/libcurl/src/version_win32.c +++ b/libs/libcurl/src/version_win32.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/version_win32.h b/libs/libcurl/src/version_win32.h index 94cc626678..9b1bd88874 100644 --- a/libs/libcurl/src/version_win32.h +++ b/libs/libcurl/src/version_win32.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vquic/ngtcp2.c b/libs/libcurl/src/vquic/ngtcp2.c index c076b7c3e7..0f2fea0af7 100644 --- a/libs/libcurl/src/vquic/ngtcp2.c +++ b/libs/libcurl/src/vquic/ngtcp2.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -126,7 +126,7 @@ quic_from_ossl_level(OSSL_ENCRYPTION_LEVEL ossl_level) case ssl_encryption_handshake: return NGTCP2_CRYPTO_LEVEL_HANDSHAKE; case ssl_encryption_application: - return NGTCP2_CRYPTO_LEVEL_APP; + return NGTCP2_CRYPTO_LEVEL_APPLICATION; default: assert(0); } @@ -143,7 +143,7 @@ quic_from_gtls_level(gnutls_record_encryption_level_t gtls_level) case GNUTLS_ENCRYPTION_LEVEL_HANDSHAKE: return NGTCP2_CRYPTO_LEVEL_HANDSHAKE; case GNUTLS_ENCRYPTION_LEVEL_APPLICATION: - return NGTCP2_CRYPTO_LEVEL_APP; + return NGTCP2_CRYPTO_LEVEL_APPLICATION; default: assert(0); } @@ -265,7 +265,7 @@ static int quic_set_encryption_secrets(SSL *ssl, qs->qconn, NULL, NULL, NULL, level, tx_secret, secretlen) != 0) return 0; - if(level == NGTCP2_CRYPTO_LEVEL_APP) { + if(level == NGTCP2_CRYPTO_LEVEL_APPLICATION) { if(init_ngh3_conn(qs) != CURLE_OK) return 0; } @@ -349,14 +349,8 @@ static int quic_init_ssl(struct quicsocket *qs) SSL_set_app_data(qs->ssl, qs); SSL_set_connect_state(qs->ssl); - switch(qs->version) { -#ifdef NGTCP2_PROTO_VER - case NGTCP2_PROTO_VER: - alpn = (const uint8_t *)NGHTTP3_ALPN_H3; - alpnlen = sizeof(NGHTTP3_ALPN_H3) - 1; - break; -#endif - } + alpn = (const uint8_t *)NGHTTP3_ALPN_H3; + alpnlen = sizeof(NGHTTP3_ALPN_H3) - 1; if(alpn) SSL_set_alpn_protos(qs->ssl, alpn, (int)alpnlen); @@ -382,7 +376,7 @@ static int secret_func(gnutls_session_t ssl, qs->qconn, NULL, NULL, NULL, level, tx_secret, secretlen) != 0) return 0; - if(level == NGTCP2_CRYPTO_LEVEL_APP) { + if(level == NGTCP2_CRYPTO_LEVEL_APPLICATION) { if(init_ngh3_conn(qs) != CURLE_OK) return -1; } @@ -532,15 +526,9 @@ static int quic_init_ssl(struct quicsocket *qs) return 1; } - switch(qs->version) { -#ifdef NGTCP2_PROTO_VER - case NGTCP2_PROTO_VER: - /* strip the first byte (the length) from NGHTTP3_ALPN_H3 */ - alpn.data = (unsigned char *)NGHTTP3_ALPN_H3 + 1; - alpn.size = sizeof(NGHTTP3_ALPN_H3) - 2; - break; -#endif - } + /* strip the first byte (the length) from NGHTTP3_ALPN_H3 */ + alpn.data = (unsigned char *)NGHTTP3_ALPN_H3 + 1; + alpn.size = sizeof(NGHTTP3_ALPN_H3) - 2; if(alpn.data) gnutls_alpn_set_protocols(qs->ssl, &alpn, 1, 0); @@ -828,11 +816,12 @@ CURLcode Curl_quic_connect(struct connectdata *conn, if(rv == -1) return CURLE_QUIC_CONNECT_ERROR; - ngtcp2_addr_init(&path.local, &qs->local_addr, qs->local_addrlen, NULL); + ngtcp2_addr_init(&path.local, (struct sockaddr *)&qs->local_addr, + qs->local_addrlen, NULL); ngtcp2_addr_init(&path.remote, addr, addrlen, NULL); rc = ngtcp2_conn_client_new(&qs->qconn, &qs->dcid, &qs->scid, &path, - NGTCP2_PROTO_VER_MAX, &ng_callbacks, + NGTCP2_PROTO_VER_MIN, &ng_callbacks, &qs->settings, NULL, qs); if(rc) return CURLE_QUIC_CONNECT_ERROR; @@ -959,7 +948,7 @@ static int cb_h3_stream_close(nghttp3_conn *conn, int64_t stream_id, void *stream_user_data) { struct Curl_easy *data = stream_user_data; - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; (void)conn; (void)stream_id; (void)app_error_code; @@ -1005,7 +994,7 @@ static int cb_h3_recv_data(nghttp3_conn *conn, int64_t stream_id, void *user_data, void *stream_user_data) { struct Curl_easy *data = stream_user_data; - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; CURLcode result = CURLE_OK; (void)conn; @@ -1064,7 +1053,7 @@ static int cb_h3_end_headers(nghttp3_conn *conn, int64_t stream_id, void *user_data, void *stream_user_data) { struct Curl_easy *data = stream_user_data; - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; CURLcode result = CURLE_OK; (void)conn; (void)stream_id; @@ -1088,7 +1077,7 @@ static int cb_h3_recv_header(nghttp3_conn *conn, int64_t stream_id, nghttp3_vec h3name = nghttp3_rcbuf_get_buf(name); nghttp3_vec h3val = nghttp3_rcbuf_get_buf(value); struct Curl_easy *data = stream_user_data; - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; CURLcode result = CURLE_OK; (void)conn; (void)stream_id; @@ -1163,6 +1152,7 @@ static nghttp3_conn_callbacks ngh3_callbacks = { cb_h3_send_stop_sending, NULL, /* push_stream */ NULL, /* end_stream */ + NULL, /* reset_stream */ }; static int init_ngh3_conn(struct quicsocket *qs) @@ -1252,7 +1242,7 @@ static ssize_t ngh3_stream_recv(struct connectdata *conn, CURLcode *curlcode) { curl_socket_t sockfd = conn->sock[sockindex]; - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; struct quicsocket *qs = conn->quic; if(!stream->memlen) { @@ -1310,7 +1300,7 @@ static int cb_h3_acked_stream_data(nghttp3_conn *conn, int64_t stream_id, void *stream_user_data) { struct Curl_easy *data = stream_user_data; - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; (void)conn; (void)stream_id; (void)user_data; @@ -1332,7 +1322,7 @@ static ssize_t cb_h3_readfunction(nghttp3_conn *conn, int64_t stream_id, { struct Curl_easy *data = stream_user_data; size_t nread; - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; (void)conn; (void)stream_id; (void)user_data; @@ -1395,7 +1385,7 @@ static ssize_t cb_h3_readfunction(nghttp3_conn *conn, int64_t stream_id, static CURLcode http_request(struct connectdata *conn, const void *mem, size_t len) { - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; size_t nheader; size_t i; size_t authority_idx; @@ -1570,7 +1560,7 @@ static CURLcode http_request(struct connectdata *conn, const void *mem, if(acc > MAX_ACC) { infof(data, "http_request: Warning: The cumulative length of all " - "headers exceeds %zu bytes and that could cause the " + "headers exceeds %d bytes and that could cause the " "stream to be rejected.\n", MAX_ACC); } } @@ -1638,7 +1628,7 @@ static ssize_t ngh3_stream_send(struct connectdata *conn, ssize_t sent; struct quicsocket *qs = conn->quic; curl_socket_t sockfd = conn->sock[sockindex]; - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; if(!stream->h3req) { CURLcode result = http_request(conn, mem, len); @@ -1715,7 +1705,8 @@ CURLcode Curl_quic_is_connected(struct connectdata *conn, } -static CURLcode ng_process_ingress(struct connectdata *conn, int sockfd, +static CURLcode ng_process_ingress(struct connectdata *conn, + curl_socket_t sockfd, struct quicsocket *qs) { ssize_t recvd; @@ -1730,7 +1721,7 @@ static CURLcode ng_process_ingress(struct connectdata *conn, int sockfd, for(;;) { remote_addrlen = sizeof(remote_addr); - while((recvd = recvfrom(sockfd, buf, bufsize, 0, + while((recvd = recvfrom(sockfd, (char *)buf, bufsize, 0, (struct sockaddr *)&remote_addr, &remote_addrlen)) == -1 && SOCKERRNO == EINTR) @@ -1739,11 +1730,11 @@ static CURLcode ng_process_ingress(struct connectdata *conn, int sockfd, if(SOCKERRNO == EAGAIN || SOCKERRNO == EWOULDBLOCK) break; - failf(conn->data, "ngtcp2: recvfrom() unexpectedly returned %d", recvd); + failf(conn->data, "ngtcp2: recvfrom() unexpectedly returned %zd", recvd); return CURLE_RECV_ERROR; } - ngtcp2_addr_init(&path.local, &qs->local_addr, + ngtcp2_addr_init(&path.local, (struct sockaddr *)&qs->local_addr, qs->local_addrlen, NULL); ngtcp2_addr_init(&path.remote, (struct sockaddr *)&remote_addr, remote_addrlen, NULL); @@ -1777,7 +1768,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd, nghttp3_vec vec[16]; ssize_t ndatalen; - switch(qs->local_addr.sa_family) { + switch(qs->local_addr.ss_family) { case AF_INET: pktlen = NGTCP2_MAX_PKTLEN_IPV4; break; @@ -1870,7 +1861,7 @@ static CURLcode ng_flush_egress(struct connectdata *conn, int sockfd, } memcpy(&remote_addr, ps.path.remote.addr, ps.path.remote.addrlen); - while((sent = send(sockfd, out, outlen, 0)) == -1 && + while((sent = send(sockfd, (const char *)out, outlen, 0)) == -1 && SOCKERRNO == EINTR) ; @@ -1908,7 +1899,7 @@ CURLcode Curl_quic_done_sending(struct connectdata *conn) { if(conn->handler == &Curl_handler_http3) { /* only for HTTP/3 transfers */ - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; struct quicsocket *qs = conn->quic; stream->upload_done = TRUE; (void)nghttp3_conn_resume_stream(qs->h3conn, stream->stream3_id); @@ -1925,7 +1916,7 @@ void Curl_quic_done(struct Curl_easy *data, bool premature) (void)premature; if(data->conn->handler == &Curl_handler_http3) { /* only for HTTP/3 transfers */ - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; Curl_dyn_free(&stream->overflow); } } @@ -1940,7 +1931,7 @@ bool Curl_quic_data_pending(const struct Curl_easy *data) buffer and allocated an overflow buffer. Since it's possible that there's no more data coming on the socket, we need to keep reading until the overflow buffer is empty. */ - const struct HTTP *stream = data->req.protop; + const struct HTTP *stream = data->req.p.http; return Curl_dyn_len(&stream->overflow) > 0; } diff --git a/libs/libcurl/src/vquic/ngtcp2.h b/libs/libcurl/src/vquic/ngtcp2.h index afdd01b7c2..c6d4d12e65 100644 --- a/libs/libcurl/src/vquic/ngtcp2.h +++ b/libs/libcurl/src/vquic/ngtcp2.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -58,7 +58,7 @@ struct quicsocket { struct quic_handshake crypto_data[3]; /* the last TLS alert description generated by the local endpoint */ uint8_t tls_alert; - struct sockaddr local_addr; + struct sockaddr_storage local_addr; socklen_t local_addrlen; nghttp3_conn *h3conn; diff --git a/libs/libcurl/src/vquic/quiche.c b/libs/libcurl/src/vquic/quiche.c index f52e9da325..d0d150e391 100644 --- a/libs/libcurl/src/vquic/quiche.c +++ b/libs/libcurl/src/vquic/quiche.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -89,8 +89,17 @@ static int quiche_perform_getsock(const struct connectdata *conn, return quiche_getsock((struct connectdata *)conn, socks); } -static CURLcode qs_disconnect(struct quicsocket *qs) +static CURLcode qs_disconnect(struct connectdata *conn, + struct quicsocket *qs) { + if(qs->conn) { + (void)quiche_conn_close(qs->conn, TRUE, 0, NULL, 0); + /* flushing the egress is not a failsafe way to deliver all the + outstanding packets, but we also don't want to get stuck here... */ + (void)flush_egress(conn, qs->sockfd, qs); + quiche_conn_free(qs->conn); + qs->conn = NULL; + } if(qs->h3config) quiche_h3_config_free(qs->h3config); if(qs->h3c) @@ -99,10 +108,6 @@ static CURLcode qs_disconnect(struct quicsocket *qs) quiche_config_free(qs->cfg); qs->cfg = NULL; } - if(qs->conn) { - quiche_conn_free(qs->conn); - qs->conn = NULL; - } return CURLE_OK; } @@ -111,14 +116,14 @@ static CURLcode quiche_disconnect(struct connectdata *conn, { struct quicsocket *qs = conn->quic; (void)dead_connection; - return qs_disconnect(qs); + return qs_disconnect(conn, qs); } void Curl_quic_disconnect(struct connectdata *conn, int tempindex) { if(conn->transport == TRNSPRT_QUIC) - qs_disconnect(&conn->hequic[tempindex]); + qs_disconnect(conn, &conn->hequic[tempindex]); } static unsigned int quiche_conncheck(struct connectdata *conn, @@ -131,7 +136,7 @@ static unsigned int quiche_conncheck(struct connectdata *conn, static CURLcode quiche_do(struct connectdata *conn, bool *done) { - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; stream->h3req = FALSE; /* not sent */ return Curl_http(conn, done); } @@ -187,6 +192,7 @@ CURLcode Curl_quic_connect(struct connectdata *conn, curl_socket_t sockfd, (void)addr; (void)addrlen; + qs->sockfd = sockfd; qs->cfg = quiche_config_new(QUICHE_PROTOCOL_VERSION); if(!qs->cfg) { failf(data, "can't create quiche config"); @@ -337,7 +343,7 @@ CURLcode Curl_quic_is_connected(struct connectdata *conn, int sockindex, return result; error: - qs_disconnect(qs); + qs_disconnect(conn, qs); return result; } @@ -358,7 +364,7 @@ static CURLcode process_ingress(struct connectdata *conn, int sockfd, break; if(recvd < 0) { - failf(conn->data, "quiche: recv() unexpectedly returned %d " + failf(conn->data, "quiche: recv() unexpectedly returned %zd " "(errno: %d, socket %d)", recvd, SOCKERRNO, sockfd); return CURLE_RECV_ERROR; } @@ -368,7 +374,7 @@ static CURLcode process_ingress(struct connectdata *conn, int sockfd, break; if(recvd < 0) { - failf(conn->data, "quiche_conn_recv() == %d", recvd); + failf(conn->data, "quiche_conn_recv() == %zd", recvd); return CURLE_RECV_ERROR; } } while(1); @@ -384,7 +390,7 @@ static CURLcode flush_egress(struct connectdata *conn, int sockfd, struct quicsocket *qs) { ssize_t sent; - static uint8_t out[1200]; + uint8_t out[1200]; int64_t timeout_ns; do { @@ -461,7 +467,7 @@ static ssize_t h3_stream_recv(struct connectdata *conn, int rc; struct h3h1header headers; struct Curl_easy *data = conn->data; - struct HTTP *stream = data->req.protop; + struct HTTP *stream = data->req.p.http; headers.dest = buf; headers.destlen = buffersize; headers.nlen = 0; @@ -549,7 +555,7 @@ static ssize_t h3_stream_send(struct connectdata *conn, ssize_t sent; struct quicsocket *qs = conn->quic; curl_socket_t sockfd = conn->sock[sockindex]; - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; if(!stream->h3req) { CURLcode result = http_request(conn, mem, len); @@ -597,7 +603,7 @@ static CURLcode http_request(struct connectdata *conn, const void *mem, { /* */ - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; size_t nheader; size_t i; size_t authority_idx; @@ -762,7 +768,7 @@ static CURLcode http_request(struct connectdata *conn, const void *mem, if(acc > MAX_ACC) { infof(data, "http_request: Warning: The cumulative length of all " - "headers exceeds %zu bytes and that could cause the " + "headers exceeds %d bytes and that could cause the " "stream to be rejected.\n", MAX_ACC); } } @@ -825,7 +831,7 @@ CURLcode Curl_quic_done_sending(struct connectdata *conn) if(conn->handler == &Curl_handler_http3) { /* only for HTTP/3 transfers */ ssize_t sent; - struct HTTP *stream = conn->data->req.protop; + struct HTTP *stream = conn->data->req.p.http; struct quicsocket *qs = conn->quic; fprintf(stderr, "!!! Curl_quic_done_sending\n"); stream->upload_done = TRUE; diff --git a/libs/libcurl/src/vquic/quiche.h b/libs/libcurl/src/vquic/quiche.h index c8d1837b56..d311e99887 100644 --- a/libs/libcurl/src/vquic/quiche.h +++ b/libs/libcurl/src/vquic/quiche.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -41,6 +41,7 @@ struct quicsocket { quiche_h3_conn *h3c; quiche_h3_config *h3config; uint8_t scid[QUICHE_MAX_CONN_ID_LEN]; + curl_socket_t sockfd; uint32_t version; }; diff --git a/libs/libcurl/src/vquic/vquic.c b/libs/libcurl/src/vquic/vquic.c index aae8e09514..7c0cc6df2a 100644 --- a/libs/libcurl/src/vquic/vquic.c +++ b/libs/libcurl/src/vquic/vquic.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vquic/vquic.h b/libs/libcurl/src/vquic/vquic.h index ecff0edf4e..eb8a893d92 100644 --- a/libs/libcurl/src/vquic/vquic.h +++ b/libs/libcurl/src/vquic/vquic.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vssh/libssh.c b/libs/libcurl/src/vssh/libssh.c index acdb4e7534..e79d8e823c 100644 --- a/libs/libcurl/src/vssh/libssh.c +++ b/libs/libcurl/src/vssh/libssh.c @@ -12,7 +12,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -664,7 +664,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SSHPROTO *protop = data->req.protop; + struct SSHPROTO *protop = data->req.p.ssh; struct ssh_conn *sshc = &conn->proto.sshc; curl_socket_t sock = conn->sock[FIRSTSOCKET]; int rc = SSH_NO_ERROR, err; @@ -1432,11 +1432,8 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block) data->req.bytecount += sshc->readdir_len + 1; /* output debug output if that is requested */ - if(data->set.verbose) { - Curl_debug(data, CURLINFO_DATA_OUT, - (char *)sshc->readdir_filename, - sshc->readdir_len); - } + Curl_debug(data, CURLINFO_DATA_OUT, (char *)sshc->readdir_filename, + sshc->readdir_len); } else { sshc->readdir_currLen = strlen(sshc->readdir_longentry); @@ -1548,12 +1545,9 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block) sshc->readdir_currLen); if(!result) { - /* output debug output if that is requested */ - if(data->set.verbose) { - Curl_debug(data, CURLINFO_DATA_OUT, sshc->readdir_line, - sshc->readdir_currLen); - } + Curl_debug(data, CURLINFO_DATA_OUT, sshc->readdir_line, + sshc->readdir_currLen); data->req.bytecount += sshc->readdir_currLen; } Curl_safefree(sshc->readdir_line); @@ -2131,7 +2125,7 @@ static CURLcode myssh_setup_connection(struct connectdata *conn) { struct SSHPROTO *ssh; - conn->data->req.protop = ssh = calloc(1, sizeof(struct SSHPROTO)); + conn->data->req.p.ssh = ssh = calloc(1, sizeof(struct SSHPROTO)); if(!ssh) return CURLE_OUT_OF_MEMORY; @@ -2154,7 +2148,7 @@ static CURLcode myssh_connect(struct connectdata *conn, bool *done) int rc; /* initialize per-handle data if not already */ - if(!data->req.protop) + if(!data->req.p.ssh) myssh_setup_connection(conn); /* We default to persistent connections. We set this already in this connect @@ -2355,7 +2349,7 @@ static CURLcode scp_disconnect(struct connectdata *conn, static CURLcode myssh_done(struct connectdata *conn, CURLcode status) { CURLcode result = CURLE_OK; - struct SSHPROTO *protop = conn->data->req.protop; + struct SSHPROTO *protop = conn->data->req.p.ssh; if(!status) { /* run the state-machine */ @@ -2608,7 +2602,7 @@ static void sftp_quote(struct connectdata *conn) { const char *cp; struct Curl_easy *data = conn->data; - struct SSHPROTO *protop = data->req.protop; + struct SSHPROTO *protop = data->req.p.ssh; struct ssh_conn *sshc = &conn->proto.sshc; CURLcode result; @@ -2638,10 +2632,9 @@ static void sftp_quote(struct connectdata *conn) sshc->nextstate = SSH_NO_STATE; return; } - if(data->set.verbose) { - Curl_debug(data, CURLINFO_HEADER_OUT, (char *) "PWD\n", 4); - Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp)); - } + Curl_debug(data, CURLINFO_HEADER_OUT, (char *) "PWD\n", 4); + Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp)); + /* this sends an FTP-like "header" to the header callback so that the current directory can be read very similar to how it is read when using ordinary FTP. */ diff --git a/libs/libcurl/src/vssh/libssh2.c b/libs/libcurl/src/vssh/libssh2.c index d983cc9a9c..a69bcda995 100644 --- a/libs/libcurl/src/vssh/libssh2.c +++ b/libs/libcurl/src/vssh/libssh2.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -798,7 +798,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; - struct SSHPROTO *sftp_scp = data->req.protop; + struct SSHPROTO *sftp_scp = data->req.p.ssh; struct ssh_conn *sshc = &conn->proto.sshc; curl_socket_t sock = conn->sock[FIRSTSOCKET]; int rc = LIBSSH2_ERROR_NONE; @@ -1265,7 +1265,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) a time-out or similar */ result = CURLE_SSH; sshc->actualcode = result; - DEBUGF(infof(data, "error = %d makes libcurl = %d\n", + DEBUGF(infof(data, "error = %lu makes libcurl = %d\n", sftperr, (int)result)); state(conn, SSH_STOP); break; @@ -1343,10 +1343,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) sshc->nextstate = SSH_NO_STATE; break; } - if(data->set.verbose) { - Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"PWD\n", 4); - Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp)); - } + Curl_debug(data, CURLINFO_HEADER_OUT, (char *)"PWD\n", 4); + Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp)); + /* this sends an FTP-like "header" to the header callback so that the current directory can be read very similar to how it is read when using ordinary FTP. */ @@ -1946,7 +1945,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) sshc->actualcode = CURLE_SSH; sftperr = LIBSSH2_FX_OK; } - failf(data, "Upload failed: %s (%d/%d)", + failf(data, "Upload failed: %s (%lu/%d)", sftperr != LIBSSH2_FX_OK ? sftp_libssh2_strerror(sftperr):"ssh error", sftperr, rc); @@ -2167,11 +2166,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) data->req.bytecount += readdir_len + 1; /* output debug output if that is requested */ - if(data->set.verbose) { - Curl_debug(data, CURLINFO_DATA_IN, sshc->readdir_filename, - readdir_len); - Curl_debug(data, CURLINFO_DATA_IN, (char *)"\n", 1); - } + Curl_debug(data, CURLINFO_DATA_IN, sshc->readdir_filename, + readdir_len); + Curl_debug(data, CURLINFO_DATA_IN, (char *)"\n", 1); } else { result = Curl_dyn_add(&sshc->readdir, sshc->readdir_longentry); @@ -2252,13 +2249,10 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) Curl_dyn_len(&sshc->readdir)); if(!result) { - /* output debug output if that is requested */ - if(data->set.verbose) { - Curl_debug(data, CURLINFO_DATA_IN, - Curl_dyn_ptr(&sshc->readdir), - Curl_dyn_len(&sshc->readdir)); - } + Curl_debug(data, CURLINFO_DATA_IN, + Curl_dyn_ptr(&sshc->readdir), + Curl_dyn_len(&sshc->readdir)); data->req.bytecount += Curl_dyn_len(&sshc->readdir); } if(result) { @@ -2887,7 +2881,6 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) static int ssh_perform_getsock(const struct connectdata *conn, curl_socket_t *sock) { -#ifdef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION int bitmap = GETSOCK_BLANK; sock[0] = conn->sock[FIRSTSOCKET]; @@ -2899,11 +2892,6 @@ static int ssh_perform_getsock(const struct connectdata *conn, bitmap |= GETSOCK_WRITESOCK(FIRSTSOCKET); return bitmap; -#else - /* if we don't know the direction we can use the generic *_getsock() - function even for the protocol_connect and doing states */ - return Curl_single_getsock(conn, sock); -#endif } /* Generic function called by the multi interface to figure out what socket(s) @@ -2911,20 +2899,11 @@ static int ssh_perform_getsock(const struct connectdata *conn, static int ssh_getsock(struct connectdata *conn, curl_socket_t *sock) { -#ifndef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION - (void)conn; - (void)sock; - /* if we don't know any direction we can just play along as we used to and - not provide any sensible info */ - return GETSOCK_BLANK; -#else /* if we know the direction we can use the generic *_getsock() function even for the protocol_connect and doing states */ return ssh_perform_getsock(conn, sock); -#endif } -#ifdef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION /* * When one of the libssh2 functions has returned LIBSSH2_ERROR_EAGAIN this * function is used to figure out in what direction and stores this info so @@ -2949,10 +2928,6 @@ static void ssh_block2waitfor(struct connectdata *conn, bool block) the original set */ conn->waitfor = sshc->orig_waitfor; } -#else - /* no libssh2 directional support so we simply don't know */ -#define ssh_block2waitfor(x,y) Curl_nop_stmt -#endif /* called repeatedly until done from multi.c */ static CURLcode ssh_multi_statemach(struct connectdata *conn, bool *done) @@ -3001,7 +2976,6 @@ static CURLcode ssh_block_statemach(struct connectdata *conn, return CURLE_OPERATION_TIMEDOUT; } -#ifdef HAVE_LIBSSH2_SESSION_BLOCK_DIRECTION if(block) { int dir = libssh2_session_block_directions(sshc->ssh_session); curl_socket_t sock = conn->sock[FIRSTSOCKET]; @@ -3015,8 +2989,6 @@ static CURLcode ssh_block_statemach(struct connectdata *conn, (void)Curl_socket_check(fd_read, CURL_SOCKET_BAD, fd_write, left>1000?1000:left); } -#endif - } return result; @@ -3029,7 +3001,7 @@ static CURLcode ssh_setup_connection(struct connectdata *conn) { struct SSHPROTO *ssh; - conn->data->req.protop = ssh = calloc(1, sizeof(struct SSHPROTO)); + conn->data->req.p.ssh = ssh = calloc(1, sizeof(struct SSHPROTO)); if(!ssh) return CURLE_OUT_OF_MEMORY; @@ -3039,21 +3011,27 @@ static CURLcode ssh_setup_connection(struct connectdata *conn) static Curl_recv scp_recv, sftp_recv; static Curl_send scp_send, sftp_send; +#ifndef CURL_DISABLE_PROXY static ssize_t ssh_tls_recv(libssh2_socket_t sock, void *buffer, size_t length, int flags, void **abstract) { struct connectdata *conn = (struct connectdata *)*abstract; ssize_t nread; CURLcode result; + Curl_recv *backup = conn->recv[0]; + struct ssh_conn *ssh = &conn->proto.sshc; (void)flags; + /* swap in the TLS reader function for this call only, and then swap back + the SSH one again */ + conn->recv[0] = ssh->tls_recv; result = Curl_read(conn, sock, buffer, length, &nread); + conn->recv[0] = backup; if(result == CURLE_AGAIN) return -EAGAIN; /* magic return code for libssh2 */ else if(result) return -1; /* generic error */ - if(conn->data->set.verbose) - Curl_debug(conn->data, CURLINFO_DATA_IN, (char *)buffer, (size_t)nread); + Curl_debug(conn->data, CURLINFO_DATA_IN, (char *)buffer, (size_t)nread); return nread; } @@ -3063,17 +3041,23 @@ static ssize_t ssh_tls_send(libssh2_socket_t sock, const void *buffer, struct connectdata *conn = (struct connectdata *)*abstract; ssize_t nwrite; CURLcode result; + Curl_send *backup = conn->send[0]; + struct ssh_conn *ssh = &conn->proto.sshc; (void)flags; + /* swap in the TLS writer function for this call only, and then swap back + the SSH one again */ + conn->send[0] = ssh->tls_send; result = Curl_write(conn, sock, buffer, length, &nwrite); + conn->send[0] = backup; if(result == CURLE_AGAIN) return -EAGAIN; /* magic return code for libssh2 */ else if(result) return -1; /* error */ - if(conn->data->set.verbose) - Curl_debug(conn->data, CURLINFO_DATA_OUT, (char *)buffer, (size_t)nwrite); + Curl_debug(conn->data, CURLINFO_DATA_OUT, (char *)buffer, (size_t)nwrite); return nwrite; } +#endif /* * Curl_ssh_connect() gets called from Curl_protocol_connect() to allow us to @@ -3089,7 +3073,7 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done) struct Curl_easy *data = conn->data; /* initialize per-handle data if not already */ - if(!data->req.protop) + if(!data->req.p.ssh) ssh_setup_connection(conn); /* We default to persistent connections. We set this already in this connect @@ -3116,6 +3100,7 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done) return CURLE_FAILED_INIT; } +#ifndef CURL_DISABLE_PROXY if(conn->http_proxy.proxytype == CURLPROXY_HTTPS) { /* * This crazy union dance is here to avoid assigning a void pointer a @@ -3153,8 +3138,15 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done) LIBSSH2_CALLBACK_RECV, sshrecv.recvp); libssh2_session_callback_set(ssh->ssh_session, LIBSSH2_CALLBACK_SEND, sshsend.sendp); + + /* Store the underlying TLS recv/send function pointers to be used when + reading from the proxy */ + ssh->tls_recv = conn->recv[FIRSTSOCKET]; + ssh->tls_send = conn->send[FIRSTSOCKET]; } - else if(conn->handler->protocol & CURLPROTO_SCP) { + +#endif /* CURL_DISABLE_PROXY */ + if(conn->handler->protocol & CURLPROTO_SCP) { conn->recv[FIRSTSOCKET] = scp_recv; conn->send[FIRSTSOCKET] = scp_send; } @@ -3307,7 +3299,7 @@ static CURLcode scp_disconnect(struct connectdata *conn, bool dead_connection) static CURLcode ssh_done(struct connectdata *conn, CURLcode status) { CURLcode result = CURLE_OK; - struct SSHPROTO *sftp_scp = conn->data->req.protop; + struct SSHPROTO *sftp_scp = conn->data->req.p.ssh; if(!status) { /* run the state-machine */ diff --git a/libs/libcurl/src/vssh/ssh.h b/libs/libcurl/src/vssh/ssh.h index 9e49993e96..377337031d 100644 --- a/libs/libcurl/src/vssh/ssh.h +++ b/libs/libcurl/src/vssh/ssh.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -182,6 +182,12 @@ struct ssh_conn { LIBSSH2_SFTP *sftp_session; /* SFTP handle */ LIBSSH2_SFTP_HANDLE *sftp_handle; +#ifndef CURL_DISABLE_PROXY + /* for HTTPS proxy storage */ + Curl_recv *tls_recv; + Curl_send *tls_send; +#endif + #ifdef HAVE_LIBSSH2_AGENT_API LIBSSH2_AGENT *ssh_agent; /* proxy to ssh-agent/pageant */ struct libssh2_agent_publickey *sshagent_identity, diff --git a/libs/libcurl/src/vssh/wolfssh.c b/libs/libcurl/src/vssh/wolfssh.c index dcbbab6c3d..b0dfb20478 100644 --- a/libs/libcurl/src/vssh/wolfssh.c +++ b/libs/libcurl/src/vssh/wolfssh.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -322,7 +322,7 @@ static CURLcode wssh_setup_connection(struct connectdata *conn) { struct SSHPROTO *ssh; - conn->data->req.protop = ssh = calloc(1, sizeof(struct SSHPROTO)); + conn->data->req.p.ssh = ssh = calloc(1, sizeof(struct SSHPROTO)); if(!ssh) return CURLE_OUT_OF_MEMORY; @@ -356,7 +356,7 @@ static CURLcode wssh_connect(struct connectdata *conn, bool *done) int rc; /* initialize per-handle data if not already */ - if(!data->req.protop) + if(!data->req.p.ssh) wssh_setup_connection(conn); /* We default to persistent connections. We set this already in this connect @@ -429,7 +429,7 @@ static CURLcode wssh_statemach_act(struct connectdata *conn, bool *block) CURLcode result = CURLE_OK; struct ssh_conn *sshc = &conn->proto.sshc; struct Curl_easy *data = conn->data; - struct SSHPROTO *sftp_scp = data->req.protop; + struct SSHPROTO *sftp_scp = data->req.p.ssh; WS_SFTPNAME *name; int rc = 0; *block = FALSE; /* we're not blocking by default */ @@ -1027,7 +1027,7 @@ static CURLcode wssh_block_statemach(struct connectdata *conn, static CURLcode wssh_done(struct connectdata *conn, CURLcode status) { CURLcode result = CURLE_OK; - struct SSHPROTO *sftp_scp = conn->data->req.protop; + struct SSHPROTO *sftp_scp = conn->data->req.p.ssh; if(!status) { /* run the state-machine */ diff --git a/libs/libcurl/src/vtls/bearssl.c b/libs/libcurl/src/vtls/bearssl.c index 44e7406e8e..b0c3dc2f07 100644 --- a/libs/libcurl/src/vtls/bearssl.c +++ b/libs/libcurl/src/vtls/bearssl.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/bearssl.h b/libs/libcurl/src/vtls/bearssl.h index 5f94922b92..d72b7d0e26 100644 --- a/libs/libcurl/src/vtls/bearssl.h +++ b/libs/libcurl/src/vtls/bearssl.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2019, Michael Forney, <mforney@mforney.org> + * Copyright (C) 2019 - 2020, Michael Forney, <mforney@mforney.org> * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/gskit.c b/libs/libcurl/src/vtls/gskit.c index dc79f487c8..17584c750f 100644 --- a/libs/libcurl/src/vtls/gskit.c +++ b/libs/libcurl/src/vtls/gskit.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/gskit.h b/libs/libcurl/src/vtls/gskit.h index b06b5e17d3..202df7e07c 100644 --- a/libs/libcurl/src/vtls/gskit.h +++ b/libs/libcurl/src/vtls/gskit.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/gtls.c b/libs/libcurl/src/vtls/gtls.c index ec3f8599b0..e848c3f05a 100644 --- a/libs/libcurl/src/vtls/gtls.c +++ b/libs/libcurl/src/vtls/gtls.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -1225,13 +1225,18 @@ gtls_connect_step3(struct connectdata *conn, certclock = gnutls_x509_crt_get_expiration_time(x509_cert); showtime(data, "expire date", certclock); + + gnutls_free(certfields.data); } rc = gnutls_x509_crt_get_issuer_dn2(x509_cert, &certfields); if(rc) infof(data, "Failed to get certificate issuer\n"); - else + else { infof(data, "\t issuer: %s\n", certfields.data); + + gnutls_free(certfields.data); + } #endif gnutls_x509_crt_deinit(x509_cert); diff --git a/libs/libcurl/src/vtls/gtls.h b/libs/libcurl/src/vtls/gtls.h index 780fc109d7..1a146a3a93 100644 --- a/libs/libcurl/src/vtls/gtls.h +++ b/libs/libcurl/src/vtls/gtls.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/keylog.c b/libs/libcurl/src/vtls/keylog.c index 70d22ecf0b..a45945f8f5 100644 --- a/libs/libcurl/src/vtls/keylog.c +++ b/libs/libcurl/src/vtls/keylog.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/keylog.h b/libs/libcurl/src/vtls/keylog.h index c6b99db938..63626da90a 100644 --- a/libs/libcurl/src/vtls/keylog.h +++ b/libs/libcurl/src/vtls/keylog.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/mbedtls.c b/libs/libcurl/src/vtls/mbedtls.c index 4e5f6574f1..191315df8b 100644 --- a/libs/libcurl/src/vtls/mbedtls.c +++ b/libs/libcurl/src/vtls/mbedtls.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/mbedtls.h b/libs/libcurl/src/vtls/mbedtls.h index 0cc64b3991..1abd331ea9 100644 --- a/libs/libcurl/src/vtls/mbedtls.h +++ b/libs/libcurl/src/vtls/mbedtls.h @@ -7,12 +7,12 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2012 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2012 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2010, Hoi-Ho Chan, <hoiho.chan@gmail.com> * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/mbedtls_threadlock.c b/libs/libcurl/src/vtls/mbedtls_threadlock.c index 4d672f106e..473f5171e2 100644 --- a/libs/libcurl/src/vtls/mbedtls_threadlock.c +++ b/libs/libcurl/src/vtls/mbedtls_threadlock.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/mbedtls_threadlock.h b/libs/libcurl/src/vtls/mbedtls_threadlock.h index 96a787d1a2..e40dfc8d6a 100644 --- a/libs/libcurl/src/vtls/mbedtls_threadlock.h +++ b/libs/libcurl/src/vtls/mbedtls_threadlock.h @@ -12,7 +12,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/mesalink.c b/libs/libcurl/src/vtls/mesalink.c index 7346a75f95..309786cf83 100644 --- a/libs/libcurl/src/vtls/mesalink.c +++ b/libs/libcurl/src/vtls/mesalink.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/mesalink.h b/libs/libcurl/src/vtls/mesalink.h index 54cb94ad3e..03f520c1dc 100644 --- a/libs/libcurl/src/vtls/mesalink.h +++ b/libs/libcurl/src/vtls/mesalink.h @@ -7,12 +7,12 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2017-2018, Yiming Jing, <jingyiming@baidu.com> - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2017 - 2018, Yiming Jing, <jingyiming@baidu.com> + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/nss.c b/libs/libcurl/src/vtls/nss.c index d0988549dd..59649ccc3a 100644 --- a/libs/libcurl/src/vtls/nss.c +++ b/libs/libcurl/src/vtls/nss.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/nssg.h b/libs/libcurl/src/vtls/nssg.h index 41e51b021d..37b364647b 100644 --- a/libs/libcurl/src/vtls/nssg.h +++ b/libs/libcurl/src/vtls/nssg.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/openssl.c b/libs/libcurl/src/vtls/openssl.c index 28a1ae6dab..e9c535f8f4 100644 --- a/libs/libcurl/src/vtls/openssl.c +++ b/libs/libcurl/src/vtls/openssl.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -225,6 +225,14 @@ "ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH" #endif +#ifdef HAVE_OPENSSL_SRP +/* the function exists */ +#ifdef USE_TLS_SRP +/* the functionality is not disabled */ +#define USE_OPENSSL_SRP +#endif +#endif + struct ssl_backend_data { /* these ones requires specific SSL-types */ SSL_CTX* ctx; @@ -1076,9 +1084,6 @@ int cert_stuff(struct connectdata *conn, /* returns non-zero on failure */ static int x509_name_oneline(X509_NAME *a, char *buf, size_t size) { -#if 0 - return X509_NAME_oneline(a, buf, size); -#else BIO *bio_out = BIO_new(BIO_s_mem()); BUF_MEM *biomem; int rc; @@ -1100,7 +1105,6 @@ static int x509_name_oneline(X509_NAME *a, char *buf, size_t size) BIO_free(bio_out); return !rc; -#endif } /** @@ -1111,6 +1115,21 @@ static int x509_name_oneline(X509_NAME *a, char *buf, size_t size) */ static int Curl_ossl_init(void) { +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && \ + !defined(LIBRESSL_VERSION_NUMBER) + const uint64_t flags = +#ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN + /* not present in BoringSSL */ + OPENSSL_INIT_ENGINE_ALL_BUILTIN | +#endif +#ifdef CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG + OPENSSL_INIT_NO_LOAD_CONFIG | +#else + OPENSSL_INIT_LOAD_CONFIG | +#endif + 0; + OPENSSL_init_ssl(flags, NULL); +#else OPENSSL_load_builtin_modules(); #ifdef USE_OPENSSL_ENGINE @@ -1129,10 +1148,6 @@ static int Curl_ossl_init(void) CONF_MFLAGS_IGNORE_MISSING_FILE); #endif -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && \ - !defined(LIBRESSL_VERSION_NUMBER) - /* OpenSSL 1.1.0+ takes care of initialization itself */ -#else /* Lets get nice error messages */ SSL_load_error_strings(); @@ -1780,6 +1795,11 @@ static CURLcode verifystatus(struct connectdata *conn, X509_STORE *st = NULL; STACK_OF(X509) *ch = NULL; struct ssl_backend_data *backend = connssl->backend; + X509 *cert; + OCSP_CERTID *id = NULL; + int cert_status, crl_reason; + ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd; + int ret; long len = SSL_get_tlsext_status_ocsp_resp(backend->handle, &status); @@ -1848,43 +1868,63 @@ static CURLcode verifystatus(struct connectdata *conn, goto end; } - for(i = 0; i < OCSP_resp_count(br); i++) { - int cert_status, crl_reason; - OCSP_SINGLERESP *single = NULL; - - ASN1_GENERALIZEDTIME *rev, *thisupd, *nextupd; + /* Compute the certificate's ID */ + cert = SSL_get_peer_certificate(backend->handle); + if(!cert) { + failf(data, "Error getting peer certficate"); + result = CURLE_SSL_INVALIDCERTSTATUS; + goto end; + } - single = OCSP_resp_get0(br, i); - if(!single) - continue; + for(i = 0; i < sk_X509_num(ch); i++) { + X509 *issuer = sk_X509_value(ch, i); + if(X509_check_issued(issuer, cert) == X509_V_OK) { + id = OCSP_cert_to_id(EVP_sha1(), cert, issuer); + break; + } + } + X509_free(cert); - cert_status = OCSP_single_get0_status(single, &crl_reason, &rev, - &thisupd, &nextupd); + if(!id) { + failf(data, "Error computing OCSP ID"); + result = CURLE_SSL_INVALIDCERTSTATUS; + goto end; + } - if(!OCSP_check_validity(thisupd, nextupd, 300L, -1L)) { - failf(data, "OCSP response has expired"); - result = CURLE_SSL_INVALIDCERTSTATUS; - goto end; - } + /* Find the single OCSP response corresponding to the certificate ID */ + ret = OCSP_resp_find_status(br, id, &cert_status, &crl_reason, &rev, + &thisupd, &nextupd); + OCSP_CERTID_free(id); + if(ret != 1) { + failf(data, "Could not find certificate ID in OCSP response"); + result = CURLE_SSL_INVALIDCERTSTATUS; + goto end; + } - infof(data, "SSL certificate status: %s (%d)\n", - OCSP_cert_status_str(cert_status), cert_status); + /* Validate the corresponding single OCSP response */ + if(!OCSP_check_validity(thisupd, nextupd, 300L, -1L)) { + failf(data, "OCSP response has expired"); + result = CURLE_SSL_INVALIDCERTSTATUS; + goto end; + } - switch(cert_status) { - case V_OCSP_CERTSTATUS_GOOD: - break; + infof(data, "SSL certificate status: %s (%d)\n", + OCSP_cert_status_str(cert_status), cert_status); - case V_OCSP_CERTSTATUS_REVOKED: - result = CURLE_SSL_INVALIDCERTSTATUS; + switch(cert_status) { + case V_OCSP_CERTSTATUS_GOOD: + break; - failf(data, "SSL certificate revocation reason: %s (%d)", - OCSP_crl_reason_str(crl_reason), crl_reason); - goto end; + case V_OCSP_CERTSTATUS_REVOKED: + result = CURLE_SSL_INVALIDCERTSTATUS; + failf(data, "SSL certificate revocation reason: %s (%d)", + OCSP_crl_reason_str(crl_reason), crl_reason); + goto end; - case V_OCSP_CERTSTATUS_UNKNOWN: - result = CURLE_SSL_INVALIDCERTSTATUS; - goto end; - } + case V_OCSP_CERTSTATUS_UNKNOWN: + default: + result = CURLE_SSL_INVALIDCERTSTATUS; + goto end; } end: @@ -2471,7 +2511,7 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex) #endif #endif const long int ssl_version = SSL_CONN_CONFIG(version); -#ifdef HAVE_OPENSSL_SRP +#ifdef USE_OPENSSL_SRP const enum CURL_TLSAUTH ssl_authtype = SSL_SET_OPTION(authtype); #endif char * const ssl_cert = SSL_SET_OPTION(primary.clientcert); @@ -2516,7 +2556,7 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex) failf(data, OSSL_PACKAGE " was built without SSLv2 support"); return CURLE_NOT_BUILT_IN; #else -#ifdef HAVE_OPENSSL_SRP +#ifdef USE_OPENSSL_SRP if(ssl_authtype == CURL_TLSAUTH_SRP) return CURLE_SSL_CONNECT_ERROR; #endif @@ -2529,7 +2569,7 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex) failf(data, OSSL_PACKAGE " was built without SSLv3 support"); return CURLE_NOT_BUILT_IN; #else -#ifdef HAVE_OPENSSL_SRP +#ifdef USE_OPENSSL_SRP if(ssl_authtype == CURL_TLSAUTH_SRP) return CURLE_SSL_CONNECT_ERROR; #endif @@ -2727,33 +2767,33 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex) if(ssl_cert || ssl_cert_blob || ssl_cert_type) { BIO *ssl_cert_bio = NULL; BIO *ssl_key_bio = NULL; - int result_cert_stuff; if(ssl_cert_blob) { /* the typecast of blob->len is fine since it is guaranteed to never be larger than CURL_MAX_INPUT_LENGTH */ ssl_cert_bio = BIO_new_mem_buf(ssl_cert_blob->data, (int)ssl_cert_blob->len); if(!ssl_cert_bio) - return CURLE_SSL_CERTPROBLEM; + result = CURLE_OUT_OF_MEMORY; } - if(SSL_SET_OPTION(key_blob)) { + if(!result && SSL_SET_OPTION(key_blob)) { ssl_key_bio = BIO_new_mem_buf(SSL_SET_OPTION(key_blob)->data, (int)SSL_SET_OPTION(key_blob)->len); if(!ssl_key_bio) - return CURLE_SSL_CERTPROBLEM; + result = CURLE_OUT_OF_MEMORY; } - result_cert_stuff = cert_stuff(conn, backend->ctx, + if(!result && + !cert_stuff(conn, backend->ctx, ssl_cert, ssl_cert_bio, ssl_cert_type, SSL_SET_OPTION(key), ssl_key_bio, - SSL_SET_OPTION(key_type), SSL_SET_OPTION(key_passwd)); + SSL_SET_OPTION(key_type), SSL_SET_OPTION(key_passwd))) + result = CURLE_SSL_CERTPROBLEM; if(ssl_cert_bio) BIO_free(ssl_cert_bio); if(ssl_key_bio) BIO_free(ssl_key_bio); - if(!result_cert_stuff) { + if(result) /* failf() is already done in cert_stuff() */ - return CURLE_SSL_CERTPROBLEM; - } + return result; } ciphers = SSL_CONN_CONFIG(cipher_list); @@ -2797,7 +2837,7 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex) } #endif -#ifdef HAVE_OPENSSL_SRP +#ifdef USE_OPENSSL_SRP if(ssl_authtype == CURL_TLSAUTH_SRP) { char * const ssl_username = SSL_SET_OPTION(username); @@ -3453,7 +3493,6 @@ typedef int numcert_t; static CURLcode get_cert_chain(struct connectdata *conn, struct ssl_connect_data *connssl) - { CURLcode result; STACK_OF(X509) *sk; @@ -4357,7 +4396,9 @@ static CURLcode Curl_ossl_md5sum(unsigned char *tmp, /* input */ (void) unused; mdctx = EVP_MD_CTX_create(); - EVP_DigestInit_ex(mdctx, EVP_md5(), NULL); + if(!mdctx) + return CURLE_OUT_OF_MEMORY; + EVP_DigestInit(mdctx, EVP_md5()); EVP_DigestUpdate(mdctx, tmp, tmplen); EVP_DigestFinal_ex(mdctx, md5sum, &len); EVP_MD_CTX_destroy(mdctx); @@ -4375,7 +4416,9 @@ static CURLcode Curl_ossl_sha256sum(const unsigned char *tmp, /* input */ (void) unused; mdctx = EVP_MD_CTX_create(); - EVP_DigestInit_ex(mdctx, EVP_sha256(), NULL); + if(!mdctx) + return CURLE_OUT_OF_MEMORY; + EVP_DigestInit(mdctx, EVP_sha256()); EVP_DigestUpdate(mdctx, tmp, tmplen); EVP_DigestFinal_ex(mdctx, sha256sum, &len); EVP_MD_CTX_destroy(mdctx); diff --git a/libs/libcurl/src/vtls/openssl.h b/libs/libcurl/src/vtls/openssl.h index 114dc4baeb..2f6e1b2db8 100644 --- a/libs/libcurl/src/vtls/openssl.h +++ b/libs/libcurl/src/vtls/openssl.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/schannel.c b/libs/libcurl/src/vtls/schannel.c index c7e4e793cc..d7bc38917f 100644 --- a/libs/libcurl/src/vtls/schannel.c +++ b/libs/libcurl/src/vtls/schannel.c @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/schannel.h b/libs/libcurl/src/vtls/schannel.h index f87bae8ff0..085b3f455c 100644 --- a/libs/libcurl/src/vtls/schannel.h +++ b/libs/libcurl/src/vtls/schannel.h @@ -12,7 +12,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/schannel_verify.c b/libs/libcurl/src/vtls/schannel_verify.c index ab7be39500..31b3b2f02f 100644 --- a/libs/libcurl/src/vtls/schannel_verify.c +++ b/libs/libcurl/src/vtls/schannel_verify.c @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/sectransp.c b/libs/libcurl/src/vtls/sectransp.c index af63df46ae..8ef60cb1f3 100644 --- a/libs/libcurl/src/vtls/sectransp.c +++ b/libs/libcurl/src/vtls/sectransp.c @@ -10,7 +10,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -1970,7 +1970,7 @@ static CURLcode sectransp_connect_step1(struct connectdata *conn, else { CURLcode result; ssl_sessionid = - aprintf("%s:%d:%d:%s:%hu", ssl_cafile, + aprintf("%s:%d:%d:%s:%ld", ssl_cafile, verifypeer, SSL_CONN_CONFIG(verifyhost), hostname, port); ssl_sessionid_len = strlen(ssl_sessionid); @@ -2189,7 +2189,7 @@ static CURLcode verify_cert(const char *cafile, struct Curl_easy *data, if(res < 0) { free(certbuf); CFRelease(array); - failf(data, "SSL: invalid CA certificate #%d (offset %d) in bundle", + failf(data, "SSL: invalid CA certificate #%d (offset %zu) in bundle", n, offset); return CURLE_SSL_CACERT_BADFILE; } diff --git a/libs/libcurl/src/vtls/sectransp.h b/libs/libcurl/src/vtls/sectransp.h index 5cec797b33..0febd6613a 100644 --- a/libs/libcurl/src/vtls/sectransp.h +++ b/libs/libcurl/src/vtls/sectransp.h @@ -8,11 +8,11 @@ * \___|\___/|_| \_\_____| * * Copyright (C) 2012 - 2014, Nick Zitzmann, <nickzman@gmail.com>. - * Copyright (C) 2012 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2012 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/vtls.c b/libs/libcurl/src/vtls/vtls.c index e65fb4f787..3bd51fdaf2 100644 --- a/libs/libcurl/src/vtls/vtls.c +++ b/libs/libcurl/src/vtls/vtls.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/vtls.h b/libs/libcurl/src/vtls/vtls.h index b86bdbc1df..f4cab9988f 100644 --- a/libs/libcurl/src/vtls/vtls.h +++ b/libs/libcurl/src/vtls/vtls.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/wolfssl.c b/libs/libcurl/src/vtls/wolfssl.c index a299b99d1f..44ee2d9ec1 100644 --- a/libs/libcurl/src/vtls/wolfssl.c +++ b/libs/libcurl/src/vtls/wolfssl.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/vtls/wolfssl.h b/libs/libcurl/src/vtls/wolfssl.h index 2b9673c0fe..d411e6913e 100644 --- a/libs/libcurl/src/vtls/wolfssl.h +++ b/libs/libcurl/src/vtls/wolfssl.h @@ -7,11 +7,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/warnless.c b/libs/libcurl/src/warnless.c index cfd5e8e141..908ee6cb70 100644 --- a/libs/libcurl/src/warnless.c +++ b/libs/libcurl/src/warnless.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/warnless.h b/libs/libcurl/src/warnless.h index ab78f9448e..ca3737859b 100644 --- a/libs/libcurl/src/warnless.h +++ b/libs/libcurl/src/warnless.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/wildcard.c b/libs/libcurl/src/wildcard.c index e94d3c544c..105bcce4ed 100644 --- a/libs/libcurl/src/wildcard.c +++ b/libs/libcurl/src/wildcard.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/wildcard.h b/libs/libcurl/src/wildcard.h index f090826fb2..081be9ed93 100644 --- a/libs/libcurl/src/wildcard.h +++ b/libs/libcurl/src/wildcard.h @@ -11,7 +11,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/x509asn1.c b/libs/libcurl/src/x509asn1.c index 52747d57df..d7cf9eb2af 100644 --- a/libs/libcurl/src/x509asn1.c +++ b/libs/libcurl/src/x509asn1.c @@ -9,7 +9,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is diff --git a/libs/libcurl/src/x509asn1.h b/libs/libcurl/src/x509asn1.h index 0b7fb88170..849714492d 100644 --- a/libs/libcurl/src/x509asn1.h +++ b/libs/libcurl/src/x509asn1.h @@ -12,7 +12,7 @@ * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is |