summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* smb: Use the correct error code for access denied on file openJuergen Hoetzel2019-07-111-0/+2
| | | | | | | | - Return CURLE_REMOTE_ACCESS_DENIED for SMB access denied on file open. Prior to this change CURLE_REMOTE_FILE_NOT_FOUND was returned instead. Closes https://github.com/curl/curl/pull/4095
* system_win32: fix clang warningGisle Vanem2019-07-111-1/+1
| | | | | | - Declare variable in header as extern. Bug: https://github.com/curl/curl/commit/48b9ea4#commitcomment-34084597
* headers: Remove no longer exported functionsDaniel Gustafsson2019-07-1011-37/+6
| | | | | | | | | | | | | | | | | | | | There were a leftover few prototypes of Curl_ functions that we used to export but no longer do, this removes those prototypes and cleans up any comments still referring to them. Curl_write32_le(), Curl_strcpy_url(), Curl_strlen_url(), Curl_up_free() Curl_concat_url(), Curl_detach_connnection(), Curl_http_setup_conn() were made static in 05b100aee247bb9bec8e9a1b0166496aa4248d1c. Curl_http_perhapsrewind() made static in 574aecee208f79d391f10d57520b3. For the remainder, I didn't trawl the Git logs hard enough to capture their exact time of deletion, but they were all gone: Curl_splayprint(), Curl_http2_send_request(), Curl_global_host_cache_dtor(), Curl_scan_cache_used(), Curl_hostcache_destroy(), Curl_second_connect(), Curl_http_auth_stage() and Curl_close_connections(). Closes #4096 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* cleanup: fix typo in commentDaniel Gustafsson2019-07-081-1/+1
|
* nss: support using libnss on macOSDaniel Gustafsson2019-07-061-1/+4
| | | | | | | | The file suffix for dynamically loadable objects on macOS is .dylib, which need to be added for the module definitions in order to get the NSS TLS backend to work properly on macOS. Closes https://github.com/curl/curl/pull/4046
* nss: don't set unused parameterDaniel Gustafsson2019-07-061-1/+1
| | | | | | | | | | | The value of the maxPTDs parameter to PR_Init() has since at least NSPR 2.1, which was released sometime in 1998, been marked ignored as is accordingly not used in the initialization code. Setting it to a value when calling PR_Init() is thus benign, but indicates an intent which may be misleading. Reset the value to zero to improve clarity. Closes https://github.com/curl/curl/pull/4054
* nss: only cache valid CRL entriesDaniel Gustafsson2019-07-061-6/+8
| | | | | | | | | Change the logic around such that we only keep CRLs that NSS actually ended up caching around for later deletion. If CERT_CacheCRL() fails then there is little point in delaying the freeing of the CRL as it is not used. Closes https://github.com/curl/curl/pull/4053
* lib: Use UTF-8 encoding in commentsGergely Nagy2019-07-064-5/+5
| | | | | | | | | | Some editors and IDEs assume that source files use UTF-8 file encodings. It also fixes the build with MSVC when /utf-8 command line option is used (this option is mandatory for some other open-source projects, this is useful when using the same options is desired for building all libraries of a project). Closes https://github.com/curl/curl/pull/4087
* docs: Fix links to OpenSSL docsJay Satiro2019-06-301-2/+0
| | | | | | | | OpenSSL changed their manual locations and does not redirect to the new locations. Bug: https://curl.haxx.se/mail/lib-2019-06/0056.html Reported-by: Daniel Stenberg
* openssl: disable engine if OPENSSL_NO_UI_CONSOLE is definedDaniel Stenberg2019-06-261-1/+1
| | | | | | | | | | ... since that needs UI_OpenSSL() which isn't provided when OpenSSL is built with OPENSSL_NO_UI_CONSOLE which happens when OpenSSL is built for UWP (with "VC-WIN32-UWP"). Reported-by: Vasily Lobaskin Fixes #4073 Closes #4077
* win32: make DLL loading a no-op for UWPDaniel Stenberg2019-06-251-1/+6
| | | | | | Reported-by: Michael Brehm Fixes #4060 Closes #4072
* http: clarify header buffer size calculationDaniel Gustafsson2019-06-241-0/+3
| | | | | | | | | | | The header buffer size calculation can from static analysis seem to overlow as it performs an addition between two size_t variables and stores the result in a size_t variable. Overflow is however guarded against elsewhere since the input to the addition is regulated by the maximum read buffer size. Clarify this with a comment since the question was asked. Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* http2: call done_sending on end of uploadDaniel Stenberg2019-06-244-6/+15
| | | | | | | | | To make sure a HTTP/2 stream registers the end of stream. Bug #4043 made me find this problem but this fix doesn't correct the reported issue. Closes #4068
* c-ares: honor port numbers in CURLOPT_DNS_SERVERSJames Brown2019-06-241-0/+4
| | | | | | | By using ares_set_servers_ports_csv on new enough c-ares. Fixes #4066 Closes #4067
* multi: enable multiplexing by default (again)Daniel Stenberg2019-06-231-0/+2
| | | | | | | It was originally made default in d7c4213bd0c (7.62.0) but mistakenly reverted in commit 2f44e94efb3d (7.65.0). Now enabled again. Closes #4051
* http2: don't call stream-close on already closed streamsDaniel Stenberg2019-06-211-4/+3
| | | | Closes #4055
* system_win32: fix typoGisle Vanem2019-06-201-1/+1
|
* configure: --disable-progress-meterDaniel Stenberg2019-06-181-55/+76
| | | | | | Builds libcurl without support for the built-in progress meter. Closes #4023
* netrc: Return the correct error code when out of memorySteve Holme2019-06-181-1/+1
| | | | | | Introduced in 763c5178. Closes #4036
* config-os400: add getpeername and getsockname definesDaniel Stenberg2019-06-181-0/+6
| | | | | | Reported-by: jonrumsey on github Fixes #4037 Closes #4039
* openssl: fix pubkey/signature algorithm detection in certinfoGergely Nagy2019-06-181-10/+17
| | | | | | | | | Certinfo gives the same result for all OpenSSL versions. Also made printing RSA pubkeys consistent with older versions. Reported-by: Michael Wallner Fixes #3706 Closes #4030
* conn_maxage: move the check to prune_dead_connections()Daniel Stenberg2019-06-171-27/+25
| | | | | | | | ... and avoid the locking issue. Reported-by: Kunal Ekawde Fixes #4029 Closes #4032
* openssl: remove outdated commentDaniel Gustafsson2019-06-171-8/+2
| | | | | | | | | | | | OpenSSL used to call exit(1) on syntax errors in OPENSSL_config(), which is why we switched to CONF_modules_load_file() and introduced a comment stating why. This behavior was however changed in OpenSSL commit abdd677125f3a9e3082f8c5692203590fdb9b860, so remove the now outdated and incorrect comment. The mentioned commit also declares OPENSSL_config() deprecated so keep the current coding. Closes #4033 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* os400: make vsetopt() non-static as Curl_vsetopt() for os400 support.Patrick Monnerat2019-06-162-6/+8
| | | | | | | | Use it in curl_easy_setopt_ccsid(). Reported-by: jonrumsey on github Fixes #3833 Closes #4028
* multi: fix the transfer hash functionDaniel Stenberg2019-06-141-1/+1
| | | | | | | | Follow-up from 8b987cc7eb Reported-by: Tom van der Woerdt Fixes #4018 Closes #4024
* krb5: fix compiler warningMarcel Raad2019-06-131-4/+2
| | | | | | | | | | | | Even though the variable was used in a DEBUGASSERT, GCC 8 warned in debug mode: krb5.c:324:17: error: unused variable 'maj' [-Werror=unused-variable] Just suppress the warning and declare the variable unconditionally instead of only for DEBUGBUILD (which also missed the check for HAVE_ASSERT_H). Closes https://github.com/curl/curl/pull/4020
* multi: fix the transfer hashes in the socket hash entriesDaniel Stenberg2019-06-122-61/+22
| | | | | | | | | | | | | - The transfer hashes weren't using the correct keys so removing entries failed. - Simplified the iteration logic over transfers sharing the same socket and they now simply are set to expire and thus get handled in the "regular" timer loop instead. Reported-by: Tom van der Woerdt Fixes #4012 Closes #4014
* url: Fix CURLOPT_MAXAGE_CONN time comparisonCliff Crosland2019-06-121-1/+1
| | | | | | | | | Old connections are meant to expire from the connection cache after CURLOPT_MAXAGE_CONN seconds. However, they actually expire after 1000x that value. This occurs because a time value measured in milliseconds is accidentally divided by 1M instead of by 1,000. Closes https://github.com/curl/curl/pull/4013
* http2: remove CURL_DISABLE_TYPECHECK defineDaniel Stenberg2019-06-111-2/+0
| | | | ... in http2-less builds as it served no use.
* wolfssl: fix key pinning build errorDaniel Stenberg2019-06-111-1/+1
| | | | follow-up from deb9462ff2de8
* wolfssl: fixup for SNI useDaniel Stenberg2019-06-101-1/+1
| | | | | | follow-up from deb9462ff2de8 Closes #4007
* wolfssl: refer to it as wolfSSL onlyDaniel Stenberg2019-06-108-141/+115
| | | | | | | | | | Remove support for, references to and use of "cyaSSL" from the source and docs. wolfSSL is the current name and there's no point in keeping references to ancient history. Assisted-by: Daniel Gustafsson Closes #3903
* bindlocal: detect and avoid IP version mismatches in bind()Daniel Stenberg2019-06-101-0/+5
| | | | | | Reported-by: Alex Grebenschikov Fixes #3993 Closes #4002
* multi: make sure 'data' can present in several sockhash entriesDaniel Stenberg2019-06-103-75/+95
| | | | | | | | | | | | | | | | | | | Since more than one socket can be used by each transfer at a given time, each sockhash entry how has its own hash table with transfers using that socket. In addition, the sockhash entry can now be marked 'blocked = TRUE'" which then makes the delete function just set 'removed = TRUE' instead of removing it "for real", as a way to not rip out the carpet under the feet of a parent function that iterates over the transfers of that same sockhash entry. Reported-by: Tom van der Woerdt Fixes #3961 Fixes #3986 Fixes #3995 Fixes #4004 Closes #3997
* unpause: trigger a timeout for event-based transfersDaniel Stenberg2019-06-093-27/+31
| | | | | | | | | | ... so that timeouts or other state machine actions get going again after a changing pause state. For example, if the last delivery was paused there's no pending socket activity. Reported-by: sstruchtrup on github Fixes #3994 Closes #4001
* build: fix Codacy warningsMarcel Raad2019-06-0510-60/+31
| | | | | | Reduce variable scopes and remove redundant variable stores. Closes https://github.com/curl/curl/pull/3975
* ssl: Update outdated "openssl-only" comments for supported backendsFrank Gevaerts2019-06-041-2/+3
| | | | | | | These are for features that used to be openssl-only but were expanded over time to support other SSL backends. Closes #3985
* NTLM: reset proxy "multipass" state when CONNECT request is doneSergey Ogryzkov2019-06-021-0/+1
| | | | Closes #3972
* http: don't parse body-related headers bodyless responsesMichael Kaufmann2019-06-022-10/+10
| | | | | | | | | | | | | | | | | | | Responses with status codes 1xx, 204 or 304 don't have a response body. For these, don't parse these headers: - Content-Encoding - Content-Length - Content-Range - Last-Modified - Transfer-Encoding This change ensures that HTTP/2 upgrades work even if a "Content-Length: 0" or a "Transfer-Encoding: chunked" header is present. Co-authored-by: Daniel Stenberg Closes #3702 Fixes #3968 Closes #3977
* singlesocket: use separate variable for inner loopDaniel Stenberg2019-06-011-4/+4
| | | | | | | | | | An inner loop within the singlesocket() function wrongly re-used the variable for the outer loop which then could cause an infinite loop. Change to using a separate variable! Reported-by: Eric Wu Fixes #3970 Closes #3973
* http2: Stop drain from being permanently set onJosie Huddleston2019-05-301-3/+4
| | | | | | | | | | | | | | | | | | Various functions called within Curl_http2_done() can have the side-effect of setting the Easy connection into drain mode (by calling drain_this()). However, the last time we unset this for a transfer (by calling drained_transfer()) is at the beginning of Curl_http2_done(). If the Curl_easy is reused for another transfer, it is then stuck in drain mode permanently, which in practice makes it unable to write any data in the new transfer. This fix moves the last call to drained_transfer() to later in Curl_http2_done(), after the functions that could potentially call for a drain. Fixes #3966 Closes #3967 Reported-by: Josie-H
* conncache: Remove the DEBUGASSERT on length checkSteve Holme2019-05-291-4/+4
| | | | | | We trust the calling code as this is an internal function. Closes #3962
* system_win32: fix function prototypeGisle Vanem2019-05-291-1/+1
| | | | | | | | - Change if_nametoindex parameter type from char * to const char *. Follow-up to 09eef8af from this morning. Bug: https://github.com/curl/curl/commit/09eef8af#r33716067
* url: Load if_nametoindex() dynamically from iphlpapi.dll on WindowsSteve Holme2019-05-294-30/+44
| | | | | | | | | | This fixes the static dependency on iphlpapi.lib and allows curl to build for targets prior to Windows Vista. This partially reverts 170bd047. Fixes #3960 Closes #3958
* http: fix "error: equality comparison with extraneous parentheses"Daniel Stenberg2019-05-291-1/+1
|
* parse_proxy: make sure portptr is initializedDaniel Stenberg2019-05-281-1/+1
| | | | | | Reported-by: Benbuck Nason fixes #3959
* url: default conn->port to the same as conn->remote_portDaniel Stenberg2019-05-282-3/+6
| | | | | | | | | | | | | | ... so that it has a sensible value when ConnectionExists() is called which needs it set to differentiate host "bundles" correctly on port number! Also, make conncache:hashkey() use correct port for bundles that are proxy vs host connections. Probably a regression from 7.62.0 Reported-by: Tom van der Woerdt Fixes #3956 Closes #3957
* conncache: make "bundles" per host name when doing proxy tunnelsDaniel Stenberg2019-05-283-17/+23
| | | | | | | | | Only HTTP proxy use where multiple host names can be used over the same connection should use the proxy host name for bundles. Reported-by: Tom van der Woerdt Fixes #3951 Closes #3955
* multi: track users of a socket betterDaniel Stenberg2019-05-282-12/+27
| | | | | | | | | | | | | | They need to be removed from the socket hash linked list with more care. When sh_delentry() is called to remove a sockethash entry, remove all individual transfers from the list first. To enable this, each Curl_easy struct now stores a pointer to the sockethash entry to know how to remove itself. Reported-by: Tom van der Woerdt and Kunal Ekawde Fixes #3952 Fixes #3904 Closes #3953
* curl-win32.h: Enable Unix Domain Sockets based on the Windows SDK versionSteve Holme2019-05-281-2/+6
| | | | | | | | | | Microsoft added support for Unix Domain Sockets in Windows 10 1803 (RS4). Rather than expect the user to enable Unix Domain Sockets by uncommenting the #define that was added in 0fd6221f we use the RS4 pre-processor variable that is present in newer versions of the Windows SDK. Closes #3939