summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* handler: refactor connection checkingMax Dymond2017-06-3020-7/+78
| | | | | | Add a new type of callback to Curl_handler which performs checks on the connection. Alter RTSP so that it uses this callback to do its own check on connection health.
* openssl: improve fallback seed of PRNG with a time based hashdmitrykos2017-06-301-17/+26
| | | | Fixes #1620
* progress: prevent resetting t_starttransferRyan Winograd2017-06-301-1/+15
| | | | | | | | | | | | | Prevent `Curl_pgrsTime` from modifying `t_starttransfer` when invoked with `TIMER_STARTTRANSFER` more than once during a single request. When a redirect occurs, this is considered a new request and `t_starttransfer` can be updated to reflect the `t_starttransfer` time of the redirect request. Closes #1616 Bug: https://github.com/curl/curl/pull/1602#issuecomment-310267370
* CURLOPT_SOCKS5_AUTH: allowed methods for SOCKS5 proxy authKamil Dudka2017-06-283-9/+27
| | | | | | | | | | | | | | | | | | If libcurl was built with GSS-API support, it unconditionally advertised GSS-API authentication while connecting to a SOCKS5 proxy. This caused problems in environments with improperly configured Kerberos: a stock libcurl failed to connect, despite libcurl built without GSS-API connected fine using username and password. This commit introduces the CURLOPT_SOCKS5_AUTH option to control the allowed methods for SOCKS5 authentication at run time. Note that a new option was preferred over reusing CURLOPT_PROXYAUTH for compatibility reasons because the set of authentication methods allowed by default was different for HTTP and SOCKS5 proxies. Bug: https://curl.haxx.se/mail/lib-2017-01/0005.html Closes https://github.com/curl/curl/pull/1454
* socks: deduplicate the code for auth requestKamil Dudka2017-06-281-9/+10
|
* socks: use proxy_user instead of proxy_nameKamil Dudka2017-06-281-16/+16
| | | | ... to make it obvious what the data is used for
* progress: progress.timespent needs to be usDaniel Stenberg2017-06-241-2/+2
| | | | follow-up to 64ed44a815e4e to fix test 500 failures
* progress: fix "time spent", broke in adef394acDaniel Stenberg2017-06-241-4/+4
|
* --request-target: instead of --strip-path-slashDaniel Stenberg2017-06-213-6/+6
| | | | | | | | | | | | | | ... and CURLOPT_REQUEST_TARGET instead of CURLOPT_STRIP_PATH_SLASH. This option instead provides the full "alternative" target to use in the request, instead of extracting the path from the URL. Test 1298 and 1299 updated accordingly. Idea-by: Evert Pot Suggestion: https://daniel.haxx.se/blog/2017/06/19/options-with-curl/comment-page-1/#comment-18373 Closes #1593
* lib: fix the djgpp buildGisle Vanem2017-06-211-1/+3
| | | | Bug: https://github.com/curl/curl/commit/73a2fcea0b4adea6ba342cd7ed1149782c214ae3#commitcomment-22655993
* if2ip: fix compiler warning in ISO C90 modeMarcel Raad2017-06-201-3/+3
| | | | | remote_scope_id is only used when both HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID and ENABLE_IPV6 are defined instead of only one of them.
* http: add --strip-path-slash and CURLOPT_STRIP_PATH_SLASHDaniel Stenberg2017-06-193-0/+12
| | | | | | | | | | | ... to enable sending "OPTIONS *" which wasn't possible previously. This option currently only works for HTTP. Added test cases 1298 + 1299 to verify Fixes #1280 Closes #1462
* getinfo: return sizes as curl_off_tDaniel Stenberg2017-06-191-0/+37
| | | | | | | | | | | | | | | This change introduces new alternatives for the existing six curl_easy_getinfo() options that return sizes or speeds as doubles. The new versions are named like the old ones but with an appended '_T': CURLINFO_CONTENT_LENGTH_DOWNLOAD_T CURLINFO_CONTENT_LENGTH_UPLOAD_T CURLINFO_SIZE_DOWNLOAD_T CURLINFO_SIZE_UPLOAD_T CURLINFO_SPEED_DOWNLOAD_T CURLINFO_SPEED_UPLOAD_T Closes #1511
* PIPELINING_SERVER_BL: cleanup the internal list useDaniel Stenberg2017-06-191-22/+15
| | | | | | | | | | | The list was freed incorrectly since the llist refactor of cbae73e1dd959. Added test 1550 to verify that it works and avoid future regressions. Reported-by: Pascal Terjan Fixes #1584 Closes #1585
* http2: fix OOM crashDaniel Stenberg2017-06-182-5/+10
| | | | torture mode with test 1021 found it
* http_proxy: fix build with http and proxyMarcel Raad2017-06-182-1/+3
| | | | | | After deff7de0eb0e22d2d142b96b9cc84cd8db5d2a48, the build without CURL_DISABLE_PROXY and CURL_DISABLE_HTTP was failing because of missing includes.
* http_proxy: fix compiler warningMarcel Raad2017-06-181-1/+2
| | | | | With CURL_DISABLE_PROXY or CURL_DISABLE_HTTP, GCC complained about a missing prototype for Curl_connect_free.
* Makefile.m32: enable -W for MinGW32 buildMarcel Raad2017-06-161-1/+1
| | | | | | The configure-based build also has this in addition to -Wall. Closes https://github.com/curl/curl/pull/1578
* http-proxy: fix chunked-encoded CONNECT responsesDaniel Stenberg2017-06-162-3/+3
| | | | | | | | Regression since 5113ad0424. ... and remove 'flaky' from test 1061 again Closes #1579
* http-proxy: deal with EAGAINDaniel Stenberg2017-06-161-2/+1
| | | | | | | | ... the previous code would reset the header length wrongly (since 5113ad0424). This makes test 1060 reliable again. Also: make sws send even smaller chunks of data to increase the likeliness of this happening.
* HTTPS-Proxy: don't offer h2 for https proxy connectionsJay Satiro2017-06-163-3/+6
| | | | | | Bug: https://github.com/curl/curl/issues/1254 Closes #1546
* url: refactor the check for Windows drive letter in pathJay Satiro2017-06-161-16/+11
| | | | | | | - Move the logic to detect a Windows drive letter prefix (eg c: in c:foo) into a function-like macro. Closes https://github.com/curl/curl/pull/1571
* mk-ca-bundle.pl: Check curl's exit code after certdata downloadJay Satiro2017-06-161-1/+1
| | | | | | | | | | - No longer allow partial downloads of certdata. Prior to this change partial downloads were (erroneously?) allowed since only the server code was checked to be 200. Bug: https://github.com/curl/curl/pull/1577 Reported-by: Matteo B.
* http-proxy: fix build with --disable-proxy or --disable-httpDaniel Stenberg2017-06-162-1/+9
| | | | Reported-by: Dan Fandrich
* http-proxy: only attempt FTP over HTTP proxyDaniel Stenberg2017-06-156-313/+14
| | | | | | | | | | ... all other non-HTTP protocol schemes are now defaulting to "tunnel trough" mode if a HTTP proxy is specified. In reality there are no HTTP proxies out there that allow those other schemes. Assisted-by: Ray Satiro, Michael Kaufmann Closes #1505
* curl_setup.h: error out on CURL_WANTS_CA_BUNDLE_ENV useDaniel Stenberg2017-06-151-0/+4
| | | | | | | | ... to make it really apparent if there's any user using this on purpose. Suggested-by: Jay Satiro Closes #1542
* lib/curl_setup.h: remove CURL_WANTS_CA_BUNDLE_ENVDaniel Stenberg2017-06-153-8/+2
| | | | | | | | | | | | | When this define was set, libcurl would check the environment variable named CURL_CA_BUNDLE at run-time and use that CA cert bundle. This feature was only defined by the watcom and m32 makefiles and caused inconsistent behaviours among libcurls built on different platforms. The curl tool does already feature its own similar logic and the library does not really need it, and it isn't documented libcurl behavior. So this change removes it. Ref: #1538
* http-proxy: do the HTTP CONNECT process entirely non-blockingDaniel Stenberg2017-06-147-129/+174
| | | | | | | Mentioned as a problem since 2007 (8f87c15bdac63) and of course it existed even before that. Closes #1547
* progress: let "current speed" be UL + DL speeds combinedDaniel Stenberg2017-06-141-7/+5
| | | | | | Bug #1556 Reported-by: Paul Harris Closes #1559
* timers: store internal time stamps as time_t instead of doublesDaniel Stenberg2017-06-145-49/+61
| | | | | | | | | | | | This gives us accurate precision and it allows us to avoid storing "no time" for systems with too low timer resolution as we then bump the time up to 1 microsecond. Should fix test 573 on windows. Remove the now unused curlx_tvdiff_secs() function. Maintains the external getinfo() API with using doubles. Fixes #1531
* includes: remove curl/curlbuild.h and curl/curlrules.hDaniel Stenberg2017-06-147-69/+10
| | | | | | | | Rely entirely on curl/system.h now. Introduced in Aug 2008 with commit 14240e9e109f. Now gone. Fixes #1456
* libressl: OCSP and intermediate certs workaround no longer neededStuart Henderson2017-06-131-1/+2
| | | | | | | | lib/vtls/openssl.c has a workaround for a bug with OCSP responses signed by intermediate certs, this was fixed in LibreSSL in https://github.com/libressl-portable/openbsd/commit/912c64f68f7ac4f225b7d1fdc8fbd43168912ba0 Bug: https://curl.haxx.se/mail/lib-2017-06/0038.html
* url: fix buffer overwrite with file protocol (CVE-2017-9502)Daniel Stenberg2017-06-131-5/+22
| | | | | | | | Bug: https://github.com/curl/curl/issues/1540 Advisory: https://curl.haxx.se/docs/adv_20170614.html Assisted-by: Ray Satiro Reported-by: Marcel Raad
* setopt: check CURLOPT_ADDRESS_SCOPE option rangeDaniel Stenberg2017-06-091-1/+4
| | | | | ... and return error instead of triggering an assert() when being way out of range.
* asyn-ares: s/Curl_expire_latest/Curl_expireDaniel Stenberg2017-06-081-1/+1
|
* expire: remove Curl_expire_latest()Daniel Stenberg2017-06-084-53/+8
| | | | | | | | | | | | | | | | | With the introduction of expire IDs and the fact that existing timers can be removed now and thus never expire, the concept with adding a "latest" timer is not working anymore as it risks to not expire at all. So, to be certain the timers actually are in line and will expire, the plain Curl_expire() needs to be used. The _latest() function was added as a sort of shortcut in the past that's quite simply not necessary anymore. Follow-up to 31b39c40cf90 Reported-by: Paul Harris Closes #1555
* file: make speedcheck use current time for checksDaniel Stenberg2017-06-071-4/+2
| | | | | | | ... as it would previously just get the "now" timestamp before the transfer starts and then not update it again. Closes #1550
* test1521: test *all* curl_easy_setopt optionsDaniel Stenberg2017-06-052-28/+40
| | | | | | | | | | | | | mk-lib1521.pl generates a test program (lib1521.c) that calls curl_easy_setopt() for every known option with a few typical values to make sure they work (ignoring the return codes). Some small changes were necessary to avoid asserts and NULL accesses when doing this. The perl script needs to be manually rerun when we add new options. Closes #1543
* curl_ntlm_core: use Curl_raw_toupper instead of toupperMarcel Raad2017-06-051-1/+1
| | | | | | This was the only remaining use of toupper in the entire source code. Suggested-by: Daniel Stenberg
* curl_ntlm_core: pass unsigned char to toupperMarcel Raad2017-06-041-1/+1
| | | | | | | | | | | Otherwise, clang on Cygwin64 warns: curl_ntlm_core.c:525:35: error: array subscript is of type 'char' [-Werror,-Wchar-subscripts] dest[2 * i] = (unsigned char)(toupper(src[i])); ^~~~~~~~~~~~~~~ /usr/include/ctype.h:152:25: note: expanded from macro 'toupper' (void) __CTYPE_PTR[__x]; (toupper) (__x);}) ^~~~
* x509asn1: fix implicit-fallthrough warning with GCC 7Marcel Raad2017-06-031-0/+1
|
* curl_sasl: fix unused-variable warningMarcel Raad2017-06-031-1/+4
| | | | | | | | This fixes the following warning with CURL_DISABLE_CRYPTO_AUTH, as seen in the autobuilds: curl_sasl.c:417:9: warning: unused variable 'serverdata' [-Wunused-variable]
* cyassl: define build macros before including ssl.hMarcel Raad2017-06-031-32/+32
| | | | | | | | | | | cyassl/ssl.h needs the macros from cyassl/options.h, so define them before including cyassl/ssl.h the first time, which happens in urldata.h. This broke the build on Ubuntu Xenial, which comes with WolfSSL 3.4.8 and therefore redefines the symbols from cyassl/options.h instead of including the header. Closes https://github.com/curl/curl/pull/1536
* dedotdot: fixed output for ".." and "." only inputDaniel Stenberg2017-06-031-1/+2
| | | | | | | Found when updating test 1395, which I did to increase test coverage of this source file... Closes #1535
* mbedtls: make TU-local variable staticMarcel Raad2017-06-021-1/+1
| | | | | mbedtls_x509_crt_profile_fr is only used locally. This fixes a missing-variable-declarations warning with clang.
* MD(4|5): silence cast-align clang warningMarcel Raad2017-06-022-2/+2
| | | | | | Unaligned access is on purpose here and the warning is harmless on affected architectures. GCC knows that, while clang warns on all architectures.
* curl_endian: remove unused functionsDaniel Stenberg2017-06-022-138/+2
| | | | Closes #1529
* build: provide easy code coverage measuringDaniel Stenberg2017-06-021-0/+4
| | | | Closes #1528
* transfer: init the infilesize from the postfields...Daniel Stenberg2017-05-302-9/+7
| | | | | | | | | ... with a strlen() if no size was set, and do this in the pretransfer function so that the info is set early. Otherwise, the default strlen() done on the POSTFIELDS data never sets state.infilesize. Reported-by: Vincas Razma Bug: #1294
* mbedtls: fix variable shadow warningJay Satiro2017-05-291-3/+3
| | | | | | vtls/mbedtls.c:804:69: warning: declaration of 'entropy' shadows a global declaration [-Wshadow] CURLcode Curl_mbedtls_random(struct Curl_easy *data, unsigned char *entropy, ^~~~~~~