summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* http2: Clarify 'Using HTTP2' verbose messageJay Satiro2021-06-151-1/+1
| | | | | | | | | | | | | | - Change phrasing from multi-use to multiplexing since the former may not be as well understood. Before: * Using HTTP2, server supports multi-use After: * Using HTTP2, server supports multiplexing Bug: https://github.com/curl/curl/discussions/7255 Reported-by: David Hu Closes https://github.com/curl/curl/pull/7258
* rustls: remove native_roots fallbackJacob Hoffman-Andrews2021-06-141-9/+0
| | | | | | | | | | | For the commandline tool, we expect to be passed SSL_CONN_CONFIG(CAfile); for library use, the use should pass a set of trusted roots (like in other TLS backends). This also removes a dependency on Security.framework when building on macOS. Closes #7250
* netrc: skip 'macdef' definitionsDaniel Stenberg2021-06-131-4/+21
| | | | | | | | Add test 494 to verify Reported-by: Harry Sintonen Fixes #7238 Closes #7244
* multi: add scan-build-6 work-around in curl_multi_fdsetDaniel Stenberg2021-06-131-1/+6
| | | | | | | | | scan-build-6 otherwise warns, saying: warning: The left operand of '>=' is a garbage value otherwise, which is false. Later scan-builds don't claim this on the same code. Closes #7248
* asyn-ares: remove check for 'data' in Curl_resolver_cancelDaniel Stenberg2021-06-131-1/+2
| | | | | | | | | It implied it would survive a NULL in there which it won't. Instead do an assert. Pointed out by scan-build. Closes #7248
* url.c: remove two variable assigns that are never readDaniel Stenberg2021-06-131-2/+0
| | | | | | Pointed out by scan-build Closes #7248
* mqtt: add support for username and passwordGealber Morales2021-06-121-30/+180
| | | | | | | Minor-edits-by: Daniel Stenberg Added test 2200 to 2205 Closes #7243
* openssl: don't remove session id entry in disassociateDaniel Stenberg2021-06-112-13/+7
| | | | | | | | | | | | When a connection is disassociated from a transfer, the Session ID entry should remain. Regression since 7f4a9a9 (shipped in libcurl 7.77.0) Reported-by: Gergely Nagy Reported-by: Paul Groke Fixes #7222 Closes #7230
* conn_shutdown: if closed during CONNECT cleanup properlyDaniel Stenberg2021-06-113-11/+24
| | | | | | | | Reported-by: Alex Xu Reported-by: Phil E. Taylor Fixes #7236 Closes #7237
* lib: don't compare fd to FD_SETSIZE when using pollMark Swaanenburg2021-06-111-0/+4
| | | | | | | | | | FD_SETSIZE is irrelevant when using poll. So ensuring that the file descriptor is smaller than FD_SETSIZE in VALID_SOCK, can cause multi_wait to ignore perfectly valid file descriptors and simply wait for 1s to avoid hammering the CPU in a busy loop. Fixes #7240 Closes #7241
* doh: fix wrong DEBUGASSERT for doh private_datazhangxiuhua2021-06-101-1/+1
| | | | Closes #7227
* configure: disable RTSP when hyper is selectedDaniel Stenberg2021-06-101-1/+1
| | | | | | Makes test 1013 work Closes #7209
* c-hyper: abort CONNECT response reading early on non 2xx responsesDaniel Stenberg2021-06-103-1/+10
| | | | | | Fixes test 493 Closes #7209
* c-hyper: fix the uploaded field in progress callbacksDaniel Stenberg2021-06-101-0/+8
| | | | | | Makes test 578 work Closes #7209
* ngtcp2: disable TLSv1.3 compatible mode when using GnuTLSJun-ya Kato2021-06-081-1/+2
| | | | | | | | | The latest GnuTLS-3.7.2 implements disable switch for TLSv1.3 compatible mode for middle box but it is enabled by default, which is unnecessary for QUIC. Fixes #6896 Closes #7202
* cookies: track expiration in jar to optimize removalsDaniel Gustafsson2021-06-082-1/+36
| | | | | | | | | | Removing expired cookies needs to be a fast operation since we want to be able to perform it often and speculatively. By tracking the timestamp of the next known expiration we can exit early in case the timestamp is in the future. Closes: #7172 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* c-hyper: support CURLINFO_STARTTRANSFER_TIMEDaniel Stenberg2021-06-071-0/+4
| | | | Closes #7204
* c-hyper: support CURLOPT_HEADERDaniel Stenberg2021-06-071-2/+10
| | | | | | | | When enabled, the headers are passed to the body write callback as well. Like in test 500 Closes #7204
* http2_connisdead: handle trailing GOAWAY betterShikha Sharma2021-06-051-1/+3
| | | | | | | | When checking the connection the input processing returns error immediately, we now consider that a dead connnection. Bug: https://curl.se/mail/lib-2021-06/0001.html Closes #7192
* ares: always store IPv6 addresses firstDmitry Karpov2021-06-051-7/+21
| | | | | | | | | | | | | | | | | | | Trying dual-stack on some embedded platform, I noticed that quite frequently (20%) libCurl starts from IPv4 regardless the Happy Eyeballs timeout value. After debugging this issue, I noticed that this happens if c-ares resolver response for IPv6 family comes before IPv4 (which was randomly happening in my tests). In such cases, because libCurl puts the last resolver response on top of the address list, when IPv4 resolver response comes after IPv6 one - the IPv4 family starts the connection phase instead of IPv6 family. The solution for this issue is to always put IPv6 addresses on top of the address list, regardless the order of resolver responses. Bug: https://curl.se/mail/lib-2021-06/0003.html Closes #7188
* Revert "Revert "socketpair: fix potential hangs""Daniel Stenberg2021-06-051-9/+25
| | | | | | | | | This reverts commit 3e70c3430a370a31eff2c1d8fea29edaca8f1127. Thus brings back the change from #7144 as was originally landed in c769d1eab4de8b Closes #7144 (again)
* schannel: move code out of SChannel_connect_step1Ebe Janchivdorj2021-06-041-322/+338
| | | | | Reviewed-by: Marc Hoersken Closes #7168
* warnless: simplify type size handlingdmitrykos2021-06-042-84/+31
| | | | | | | By using sizeof(T), existing defines and relying on the compiler to define the required signed/unsigned mask. Closes #7181
* [Win32] Fix for USE_WATT32Gisle Vanem2021-06-041-1/+1
| | | My Watt-32 tcp/ip stack works on Windows but it does not have `WSAIoctl()`
* url: bad CURLOPT_CONNECT_TO syntax now returns errorAlexis Vachette2021-06-041-6/+10
| | | | | | Added test 3020 to verify Closes #7183
* test269: disable for hyperDaniel Stenberg2021-06-031-0/+4
| | | | | | | --ignore-content-length / CURLOPT_IGNORE_CONTENT_LENGTH doesn't work with hyper. Closes #7184
* hostip: bad CURLOPT_RESOLVE syntax now returns errorAlexis Vachette2021-06-031-2/+2
| | | | | | Added test 3019 Fixes #7170 Closes #7174
* cookies: fix typo and expand commentDaniel Gustafsson2021-06-031-1/+2
| | | | | Fix a typo in the sorting comment, and while in there elaborate slightly on why creationtime can be used as a tiebreaker.
* cookies: remove unused headerDaniel Gustafsson2021-06-031-1/+0
| | | | | | | | | Commit 1c1d9f1affbd3367bcb24062e261d0ea5d185e3a removed the last use for the inet_pton.h headerfile, this removes the inclusion of the header. Closes: #7182 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* Revert "socketpair: fix potential hangs"Daniel Stenberg2021-06-031-25/+9
| | | | | | This reverts commit c769d1eab4de8b9f1bd84d992c63692fdc43c5be. See #7144 for details
* socketpair: fix potential hangsPaul Groke2021-06-031-9/+25
| | | | | | | | | | | Fixes potential hang in accept by using select + non-blocking accept. Fixes potential hang in peer check by replacing the send/recv check with a getsockname/getpeername check. Adds length check for returned sockaddr data. Closes #7144
* CURLE_SETOPT_OPTION_SYNTAX: new error name for wrong setopt syntaxDaniel Stenberg2021-06-022-4/+4
| | | | | | | | | For options that pass in lists or strings that are subsequently parsed and must be correct. This broadens the scope for the option previously known as CURLE_TELNET_OPTION_SYNTAX but the old name is of course still provided as a #define for existing applications. Closes #7175
* mqtt: detect illegal and too large file sizeHarry Sintonen2021-06-021-0/+10
| | | | | Add test 3017 and 3018 to verify. Closes #7166
* define: re-add CURL_DISABLE_NTLM and corresponding ifdefstheawless2021-06-022-17/+16
| | | | | | | This flag will be further exposed by adding build options. Reverts #6809 Closes #7028
* hostip: fix 3 coverity complaintsDaniel Stenberg2021-06-011-3/+6
| | | | | | | | | | | | | | Follow-up to 1a0ebf6632f889eed - Check the return code to Curl_inet_pton() in two instances, even though we know the input is valid so the functions won't fail. - Clear the 'struct sockaddr_in' struct before use so that the 'sin_zero' field isn't left uninitialized. Detected by Coverity. Assisted-by: Harry Sintonen Closes #7163
* c-hyper: fix NTLM on closed connection tested with test159Daniel Stenberg2021-06-012-2/+21
| | | | Closes #7154
* conncache: lowercase the hash key for better matchDaniel Stenberg2021-06-011-0/+2
| | | | | | | | | | As host names are case insensitive, the use of case sensitive hashing caused unnecesary cache misses and therefore lost performance. This lowercases the hash key. Reported-by: Harry Sintonen Fixes #7159 Closes #7161
* mbedtls: make mbedtls_strerror always workDaniel Stenberg2021-06-011-30/+6
| | | | | | | If the function doesn't exist, provide a macro that just clears the error message. Removes #ifdef uses from the code. Closes #7162
* vtls: exit addsessionid if no cache is initedDaniel Stenberg2021-06-011-2/+7
| | | | | | | | Follow-up to b249592d29ae0 Avoids NULL pointer derefs. Closes #7165
* Curl_ntlm_core_mk_nt_hash: fix OOM in error pathHarry Sintonen2021-06-011-9/+6
| | | | Closes #7164
* ssl: read pending close notify alert before closing the connectionMichael Kaufmann2021-06-015-1/+28
| | | | | | | | | | | | | | | | | | | | | This avoids a TCP reset (RST) if the server initiates a connection shutdown by sending an SSL close notify alert and then closes the TCP connection. For SSL connections, usually the server announces that it will close the connection with an SSL close notify alert. curl should read this alert. If curl does not read this alert and just closes the connection, some operating systems close the TCP connection with an RST flag. See RFC 1122, section 4.2.2.13 If curl reads the close notify alert, the TCP connection is closed normally with a FIN flag. The new code is similar to existing code in the "SSL shutdown" function: try to read an alert (non-blocking), and ignore any read errors. Closes #7095
* setopt: fix incorrect commentsLaurent Dufresne2021-06-011-4/+4
| | | | Closes #7157
* mbedtls: add support for cert and key blob optionsLaurent Dufresne2021-06-011-12/+50
| | | | | | | CURLOPT_SSLCERT_BLOB and CURLOPT_SSLKEY_BLOB weren't usable with mbedtls backend, so the support was added. Closes #7157
* http2: init recvbuf struct for pushed streamsDaniel Stenberg2021-05-311-0/+2
| | | | | | | | Debug builds would warn that these structs were not initialized properly for pushed streams. Ref: #7148 Closes #7153
* Curl_ssl_getsessionid: fail if no session cache existsDaniel Stenberg2021-05-311-2/+3
| | | | | | | | | This function might get called for an easy handle for which the session cache hasn't been setup. It now just returns a "miss" in that case. Reported-by: Christoph M. Becker Fixes #7148 Closes #7153
* hostip: make 'localhost' return fixed valuesDaniel Stenberg2021-05-311-2/+73
| | | | | | | | | | | | Resolving the case insensitive host name 'localhost' now returns the addresses 127.0.0.1 and (if IPv6 is enabled) ::1 without using any resolver. This removes the risk that users accidentally resolves 'localhost' to something else. By making sure 'localhost' is always local, we can assume a "secure context" for such transfers (for cookies etc). Closes #7039
* hsts: ignore numberical IP address hostsDaniel Stenberg2021-05-306-40/+32
| | | | | | | | | Also, use a single function library-wide for detecting if a given hostname is a numerical IP address. Reported-by: Harry Sintonen Fixes #7146 Closes #7149
* c-hyper: handle NULL from hyper_buf_copy()Daniel Stenberg2021-05-281-4/+13
| | | | Closes #7143
* c-hyper: convert HYPERE_INVALID_PEER_MESSAGE to CURLE_UNSUPPORTED_PROTOCOLDaniel Stenberg2021-05-271-0/+2
| | | | | | Makes test 129 work (HTTP/1.2 response). Closes #7141
* http_proxy: deal with non-200 CONNECT response with HyperDaniel Stenberg2021-05-271-3/+32
| | | | | | Makes test 94 and 95 work Closes #7141