summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* asyn.h: remove the Curl_resolver_getsock definebagder/asyn-h-getsockDaniel Stenberg2020-07-031-1/+0
| | | | | | - not used - used the wrong number of arguments - confused the Codeacy code analyzer
* http2: close the http2 connection when no more requests may be sentLaramie Leavitt2020-07-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Well-behaving HTTP2 servers send two GOAWAY messages. The first message is a warning that indicates that the server is going to stop accepting streams. The second one actually closes the stream. nghttp2 reports this state (and the other state of no more stream identifiers) via the call nghttp2_session_check_request_allowed(). In this state the client should not create more streams on the session (tcp connection), and in curl this means that the server has requested that the connection is closed. It would be also be possible to put the connclose() call into the on_http2_frame_recv() function that triggers on the GOAWAY message. This fixes a bug seen when the client sees the following sequence of frames: // advisory GOAWAY HTTP2 GOAWAY [stream-id = 0, promised-stream-id = -1] ... some additional frames // final GOAWAY HTTP2 GOAWAY [stream-id = 0, promised-stream-id = N ] Before this change, curl will attempt to reuse the connection even after the last stream, will encounter this error: * Found bundle for host localhost: 0x5595f0a694e0 [can multiplex] * Re-using existing connection! (#0) with host localhost * Connected to localhost (::1) port 10443 (#0) * Using Stream ID: 9 (easy handle 0x5595f0a72e30) > GET /index.html?5 HTTP/2 > Host: localhost:10443 > user-agent: curl/7.68.0 > accept: */* > * stopped the pause stream! * Connection #0 to host localhost left intact curl: (16) Error in the HTTP2 framing layer This error may posion the connection cache, causing future requests which resolve to the same curl connection to go through the same error path. Closes #5643
* http2: fix nghttp2_strerror -> nghttp2_http2_strerror in debug messagesJeremy Maitin-Shepard2020-07-021-2/+2
| | | | | | | | | Confusingly, nghttp2 has two different error code enums: - nghttp2_error, to be used with nghttp2_strerror - nghttp2_error_code, to be used with nghttp2_http2_strerror Closes #5641
* url: silence MSVC warningMarcel Raad2020-07-021-1/+1
| | | | | | | | | | | | | | Since commit f3d501dc678, if proxy support is disabled, MSVC warns: url.c : warning C4701: potentially uninitialized local variable 'hostaddr' used url.c : error C4703: potentially uninitialized local pointer variable 'hostaddr' used That could actually only happen if both `conn->bits.proxy` and `CURL_DISABLE_PROXY` were enabled. Initialize it to NULL to silence the warning. Closes https://github.com/curl/curl/pull/5638
* Revert "multi: implement wait using winsock events"Daniel Stenberg2020-06-302-122/+4
| | | | | | | | | | This reverts commit 8bc25c590e530de87595d1bb3577f699eb1309b9. That commit (from #5397) introduced a regression in 7.71.0. Reported-by: tmkk on github Fixes #5631 Closes #5632
* ngtcp2: sync with current masterDaniel Stenberg2020-06-291-1/+3
| | | | | | | | ngtcp2 added two new callbacks Reported-by: Lucien Zürcher Fixes #5624 Closes #5627
* vtls: compare cert blob when finding a connection to reuseDaniel Stenberg2020-06-293-1/+46
| | | | | | Reported-by: Gergely Nagy Fixes #5617 Closes #5619
* terminology: call them null-terminated stringsDaniel Stenberg2020-06-2815-28/+28
| | | | | | | | | | | Updated terminology in docs, comments and phrases to refer to C strings as "null-terminated". Done to unify with how most other C oriented docs refer of them and what users in general seem to prefer (based on a single highly unscientific poll on twitter). Reported-by: coinhubs on github Fixes #5598 Closes #5608
* http: fix proxy auth with blank passwordDaniel Stenberg2020-06-281-1/+1
| | | | | | | | | | Regression in 7.71.0 Added test case 346 to verify. Reported-by: Kristoffer Gleditsch Fixes #5613 Closes #5616
* mbedtls: fix build with disabled proxy supportBaruch Siach2020-06-261-0/+10
| | | | | | | | | Don't reference fields that do not exist. Fixes build failure: vtls/mbedtls.c: In function 'mbed_connect_step1': vtls/mbedtls.c:249:54: error: 'struct connectdata' has no member named 'http_proxy' Closes #5615
* url: allow user + password to contain "control codes" for HTTP(S)Daniel Stenberg2020-06-253-12/+25
| | | | | | Reported-by: Jon Johnson Jr Fixes #5582 Closes #5592
* escape: make the URL decode able to reject only %00 bytesDaniel Stenberg2020-06-2516-34/+60
| | | | | | ... or all "control codes" or nothing. Assisted-by: Nicolas Sterchele
* http2: set the correct URL in pushed transfersDaniel Stenberg2020-06-251-0/+44
| | | | | | | | | ...previously CURLINFO_EFFECTIVE_URL would report the URL of the original "mother transfer", not the actually pushed resource. Reported-by: Jonathan Cardoso Machado Fixes #5589 Closes #5591
* openssl: Fix compilation on Windows when ngtcp2 is enabledJavier Blazquez2020-06-251-4/+5
| | | | | | | - Include wincrypt before OpenSSL includes so that the latter can properly handle any conflicts between the two. Closes https://github.com/curl/curl/pull/5606
* escape: zero length input should return a zero length outputDaniel Stenberg2020-06-251-0/+3
| | | | | | | | Regression added in 7.71.0. Fixes #5601 Reported-by: Kristoffer Gleditsch Closes #5602
* Curl_inet_ntop: always check the return codeDaniel Stenberg2020-06-242-7/+13
| | | | | | Reported-by: Siva Sivaraman Fixes #5412 Closes #5597
* sendf: improve the message on client write errorsDaniel Stenberg2020-06-241-1/+1
| | | | | | | | | Replace "Failed writing body (X != Y)" with "Failure writing output to destination". Possibly slightly less cryptic. Reported-by: coinhubs on github Fixes #5594 Closes #5596
* url: make sure pushed streams get an allocated download bufferDaniel Stenberg2020-06-233-4/+11
| | | | | | | | | Follow-up to c4e6968127e876b0 When a new transfer is created, as a resuly of an acknowledged push, that transfer needs a download buffer allocated. Closes #5590
* openssl: Don't ignore CA paths when using Windows CA storeJay Satiro2020-06-221-13/+9
| | | | | | | | | | | | | This commit changes the behavior of CURLSSLOPT_NATIVE_CA so that it does not override CURLOPT_CAINFO / CURLOPT_CAPATH, or the hardcoded default locations. Instead the CA store can now be used at the same time. The change is due to the impending release. The issue is still being discussed. The behavior of CURLSSLOPT_NATIVE_CA is subject to change and is now documented as experimental. Ref: bc052cc (parent commit) Ref: https://github.com/curl/curl/issues/5585
* openssl: Fix CA fallback logic for OpenSSL 3.0 buildJay Satiro2020-06-221-1/+1
| | | | | | | Prior to this change I assume a build error would occur when CURL_CA_FALLBACK was used. Closes https://github.com/curl/curl/pull/5587
* copyright: update mismatched copyright yearsDaniel Stenberg2020-06-221-1/+1
|
* multibyte: Fixed access-> waccess to file for Windows PlarformValentyn Korniienko2020-06-212-0/+25
| | | | | Reviewed-by: Marcel Raad Closes #5580
* altsvc: bump to h3-29Daniel Stenberg2020-06-191-2/+2
| | | | Closes #5584
* connect: improve happy eyeballs handlingDaniel Stenberg2020-06-185-58/+84
| | | | | | | | For QUIC but also for regular TCP when the second family runs out of IPs with a failure while the first family is still trying to connect. Separated the timeout handling for IPv4 and IPv6 connections when they both have a number of addresses to iterate over.
* ngtcp2: never call fprintf() in lib code in release versionDaniel Stenberg2020-06-181-12/+14
|
* ngtcp2: fix happy eyeballs quic connect crashDaniel Stenberg2020-06-181-1/+2
| | | | | | Reported-by: Peter Wu Fixes #5565 Closes #5568
* select: remove the unused ELAPSED_MS() macroDaniel Stenberg2020-06-181-3/+0
| | | | Closes #5573
* multi: implement wait using winsock eventsrcombs2020-06-172-4/+122
| | | | | | | | | | | | This avoids using a pair of TCP ports to provide wakeup functionality for every multi instance on Windows, where socketpair() is emulated using a TCP socket on loopback which could in turn lead to socket resource exhaustion. Reviewed-by: Gergely Nagy Reviewed-by: Marc Hörsken Closes #5397
* ntlm: enable NTLM support with wolfSSLRuurd Beerstra2020-06-165-19/+24
| | | | | | | | | When wolfSSL is built with its OpenSSL API layer, it fetures the same DES* functions that OpenSSL has. This change take advantage of that. Co-authored-by: Daniel Stenberg Closes #5556 Fixes #5548
* http: move header storage to Curl_easy from connectdataDaniel Stenberg2020-06-1510-130/+137
| | | | | | | | | | | | Since the connection can be used by many independent requests (using HTTP/2 or HTTP/3), things like user-agent and other transfer-specific data MUST NOT be kept connection oriented as it could lead to requests getting the wrong string for their requests. This struct data was lingering like this due to old HTTP1 legacy thinking where it didn't mattered.. Fixes #5566 Closes #5567
* altsvc: remove the num field from the altsvc structDaniel Stenberg2020-06-122-4/+0
| | | | | | | | It was superfluous since we have the list.size alredy Reported-by: Jay Satiro Fixes #5553 Closes #5563
* share: don't set the share flag it something failsDaniel Stenberg2020-06-121-3/+5
| | | | | | | | When asking for a specific feature to be shared in the share object, that bit was previously set unconditionally even if the shared feature failed or otherwise wouldn't work. Closes #5554
* wording: avoid blacklist/whitelist stereotypesDaniel Stenberg2020-06-102-12/+11
| | | | | | | | Instead of discussing if there's value or meaning (implied or not) in the colors, let's use words without the same possibly negative associations. Closes #5546
* socks: detect connection close during handshakeDaniel Stenberg2020-06-081-4/+28
| | | | | | | | | The SOCKS4/5 state machines weren't properly terminated when the proxy connection got closed, leading to a busy-loop. Reported-By: zloi-user on github Fixes #5532 Closes #5542
* multi: add defensive check on data->multi->num_alivexquery2020-06-081-1/+3
| | | | Closes #5540
* Curl_addrinfo: use one malloc instead of threeDaniel Stenberg2020-06-082-56/+22
| | | | | | | | To reduce the amount of allocations needed for creating a Curl_addrinfo struct, make a single larger malloc instead of three separate smaller ones. Closes #5533
* quiche: update SSLKEYLOGFILE supportAlessandro Ghedini2020-06-081-1/+7
| | | | | | | | quiche now requires the application to explicitly set the keylog path for each connection, rather than reading the environment variable itself. Closes #5541
* ngtcp2: update with recent API changesDaniel Stenberg2020-06-081-5/+8
| | | | | | | Syncs with ngtcp2 commit 7e9a917d386d98 merged June 7 2020. Assisted-by: Tatsuhiro Tsujikawa Closes #5538
* socks: remove unreachable breaks in socks.c and mime.cxquery2020-06-082-5/+3
| | | | Closes #5537
* libssh2: keep sftp errors as 'unsigned long'Daniel Stenberg2020-06-081-62/+66
| | | | | | | Remove weird work-around for storing the SFTP errors as int instead of the "unsigned long" that libssh2 actually returns for SFTP errors. Closes #5534
* timeouts: move ms timeouts to timediff_t from int and longMarc Hoersken2020-06-065-9/+13
| | | | | | | | | | | | | Now that all functions in select.[ch] take timediff_t instead of the limited int or long, we can remove type conversions and related preprocessor checks to silence compiler warnings. Avoiding conversions from time_t was already done in 842f73de. Based upon #5262 Supersedes #5214, #5220 and #5221 Follow up to #5343 and #5479 Closes #5490
* openssl: set FLAG_TRUSTED_FIRST unconditionallyFrançois Rigault2020-06-061-4/+3
| | | | | | | | | | | | | On some systems, openssl 1.0.x is still the default, but it has been patched to contain all the recent security fixes. As a result of this patching, it is possible for macro X509_V_FLAG_NO_ALT_CHAINS to be defined, while the previous behavior of openssl to not look at trusted chains first, remains. Fix it: ensure X509_V_FLAG_TRUSTED_FIRST is always set, do not try to probe for the behavior of openssl based on the existence ofmacros. Closes #5530
* socks: fix expected length of SOCKS5 replyCherish982020-06-051-0/+7
| | | | | | | | | Commit 4a4b63d forgot to set the expected SOCKS5 reply length when the reply ATYP is X'01'. This resulted in erroneously expecting more bytes when the request length is greater than the reply length (e.g., when remotely resolving the hostname). Closes #5527
* trailers: switch h1-trailer logic to use dynbufDaniel Stenberg2020-06-054-37/+21
| | | | | | In the continued effort to remove "manual" realloc schemes. Closes #5524
* quiche: advertise draft 28 supportPeter Wu2020-06-042-3/+15
| | | | | | | Fix the verbose message while at it, quiche currently supports draft 27 and draft 28 simultaneously. Closes #5518
* altsvc: fix 'dsthost' may be used uninitialized in this functionDaniel Stenberg2020-06-031-1/+1
|
* urldata: let the HTTP method be in the set.* structDaniel Stenberg2020-06-0210-59/+56
| | | | | | | | | | | | When the method is updated inside libcurl we must still not change the method as set by the user as then repeated transfers with that same handle might not execute the same operation anymore! This fixes the libcurl part of #5462 Test 1633 added to verify. Closes #5499
* hostip: fix the memory-leak introduced in 67d2802Daniel Stenberg2020-06-021-6/+15
| | | | | Fixes #5503 Closes #5504
* vtls: repair the build with `CURL_DISABLE_PROXY`Saleem Abdulrasool2020-06-012-0/+16
| | | | | | | | | `http_proxy` will not be available in `conndata` if `CURL_DISABLE_PROXY` is enabled. Repair the build with that configuration. Follow-up to f3d501dc67 Closes #5498
* transfer: remove k->str NULL checkDaniel Stenberg2020-06-011-1/+1
| | | | | | | | | | "Null-checking k->str suggests that it may be null, but it has already been dereferenced on all paths leading to the check" - and it can't legally be NULL at this point. Remove check. Detected by Coverity CID 1463884 Closes #5495