summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* cli tool: do not use mime.h private structures.Patrick Monnerat2019-02-111-0/+2
| | | | | | | | | | Option -F generates an intermediate representation of the mime structure that is used later to create the libcurl mime structure and generate the --libcurl statements. Reported-by: Daniel Stenberg Fixes #3532 Closes #3546
* cleanup: make local functions staticDaniel Stenberg2019-02-103-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | urlapi: turn three local-only functions into statics conncache: make conncache_find_first_connection static multi: make detach_connnection static connect: make getaddressinfo static curl_ntlm_core: make hmac_md5 static http2: make two functions static http: make http_setup_conn static connect: make tcpnodelay static tests: make UNITTEST a thing to mark functions with, so they can be static for normal builds and non-static for unit test builds ... and mark Curl_shuffle_addr accordingly. url: make up_free static setopt: make vsetopt static curl_endian: make write32_le static rtsp: make rtsp_connisdead static warnless: remove unused functions memdebug: remove one unused function, made another static
* runtests.pl: Fix perl call to include srcdirLadar Levison2019-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | - Use explicit include opt for perl calls. Prior to this change some scripts couldn't find their dependencies. At the top, perl is called using with the "-Isrcdir" option, and it works: https://github.com/curl/curl/blob/curl-7_63_0/tests/runtests.pl#L183 But on line 3868, that option is omitted. This caused problems for me, as the symbol-scan.pl script in particular couldn't find its dependencies properly: https://github.com/curl/curl/blob/curl-7_63_0/tests/runtests.pl#L3868 This patch fixes that oversight by making calls to perl sub-shells uniform. Closes https://github.com/curl/curl/pull/3496
* unit1653: make it survive torture testsDaniel Stenberg2019-01-281-16/+63
|
* tests: move objnames-* from lib into testsDaniel Stenberg2019-01-156-10/+552
| | | | | | | Since they're used purely for testing purposes, I think they should rather be stored there. Closes #3470
* urldata: rename easy_conn to just connDaniel Stenberg2019-01-111-4/+4
| | | | | | | | | | | | | | | We use "conn" everywhere to be a pointer to the connection. Introduces two functions that "attaches" and "detaches" the connection to and from the transfer. Going forward, we should favour using "data->conn" (since a transfer always only has a single connection or none at all) to "conn->data" (since a connection can have none, one or many transfers associated with it and updating conn->data to be correct is error prone and a frequent reason for internal issues). Closes #3442
* test1558: verify CURLINFO_PROTOCOL on file:// transferDaniel Stenberg2019-01-104-2/+120
| | | | | | Attempt to reproduce issue #3444. Closes #3447
* xattr: strip credentials from any URL that is storedDaniel Stenberg2019-01-104-2/+122
| | | | | | | | | Both user and password are cleared uncondtitionally. Added unit test 1621 to verify. Fixes #3423 Closes #3433
* cookies: allow secure override when done over HTTPSDaniel Stenberg2019-01-102-1/+73
| | | | | | | | Added test 1562 to verify. Reported-by: Jeroen Ooms Fixes #3445 Closes #3450
* test1561: improve test nameDaniel Stenberg2019-01-091-1/+1
| | | | [skip ci]
* cookies: skip custom cookies when redirecting cross-siteKatsuhiko YOSHIDA2019-01-092-1/+91
| | | | Closes #3417
* tests: allow tests to pass by 2037-02-12Bernhard M. Wiedemann2019-01-088-23/+23
| | | | | | similar to commit f508d29f3902104018 Closes #3443
* curl_multi_remove_handle() don't block terminating c-ares requestsBrad Spencer2019-01-074-4/+164
| | | | | | | | | Added Curl_resolver_kill() for all three resolver modes, which only blocks when necessary, along with test 1592 to confirm curl_multi_remove_handle() doesn't block unless it must. Closes #3428 Fixes #3371
* printf: fix format specifiersRikard Falkeborn2019-01-042-8/+8
| | | | Closes #3426
* libtest/stub_gssapi: use "real" snprintfDaniel Stenberg2019-01-031-7/+6
| | | | | | | | | | | | | ... since it doesn't link with libcurl. Reverts the commit dcd6f81025 changes from this file. Bug: https://curl.haxx.se/mail/lib-2019-01/0000.html Reported-by: Shlomi Fish Reviewed-by: Daniel Gustafsson Reviewed-by: Kamil Dudka Closes #3434
* tvnow: silence conversion warningsMarcel Raad2019-01-011-1/+1
| | | | | | MinGW-w64 defaults to targeting Windows 7 now, so GetTickCount64 is used and the milliseconds are represented as unsigned long long, leading to a compiler warning when implicitly converting them to long.
* ntlm: update selection of type 3 responseMarkus Moeller2019-01-0137-145/+145
| | | | | | | | | | | NTLM2 did not work i.e. no NTLMv2 response was created. Changing the check seems to work. Ref: https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-NLMP/[MS-NLMP].pdf Fixes https://github.com/curl/curl/issues/3286 Closes https://github.com/curl/curl/pull/3287 Closes https://github.com/curl/curl/pull/3415
* urlapi: fix parsing ipv6 with zone indexDaniel Gustafsson2018-12-301-0/+8
| | | | | | | | | | | | | | The previous fix for parsing IPv6 URLs with a zone index was a paddle short for URLs without an explicit port. This patch fixes that case and adds a unit test case. This bug was highlighted by issue #3408, and while it's not the full fix for the problem there it is an isolated bug that should be fixed regardless. Closes #3411 Reported-by: GitYuanQu on github Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* hostip: support wildcard hostsClaes Jakobsson2018-12-272-1/+57
| | | | | | | | | | | | | | | | | This adds support for wildcard hosts in CURLOPT_RESOLVE. These are try-last so any non-wildcard entry is resolved first. If specified, any host not matched by another CURLOPT_RESOLVE config will use this as fallback. Example send a.com to 10.0.0.1 and everything else to 10.0.0.2: curl --resolve *:443:10.0.0.2 --resolve a.com:443:10.0.0.1 \ https://a.com https://b.com This is probably quite similar to using: --connect-to a.com:443:10.0.0.1:443 --connect-to :443:10.0.0.2:443 Closes #3406 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* http: added options for allowing HTTP/0.9 responsesDaniel Stenberg2018-12-2118-8/+71
| | | | | | | | | | | | Added CURLOPT_HTTP09_ALLOWED and --http0.9 for this purpose. For now, both the tool and library allow HTTP/0.9 by default. docs/DEPRECATE.md lays out the plan for when to reverse that default: 6 months after the 7.64.0 release. The options are added already now so that applications/scripts can start using them already now. Fixes #2873 Closes #3383
* cookies: extend domain checks to non psl buildsDaniel Gustafsson2018-12-191-0/+1
| | | | | | | | | Ensure to perform the checks we have to enforce a sane domain in the cookie request. The check for non-PSL enabled builds is quite basic but it's better than nothing. Closes #2964 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* http: minor whitespace cleanup from f464535bDaniel Stenberg2018-12-141-1/+0
|
* http: Implement trailing headers for chunked transfersAyoub Boudhar2018-12-146-1/+197
| | | | | | | | | | | | | This adds the CURLOPT_TRAILERDATA and CURLOPT_TRAILERFUNCTION options that allow a callback based approach to sending trailing headers with chunked transfers. The test server (sws) was updated to take into account the detection of the end of transfer in the case of trailing headers presence. Test 1591 checks that trailing headers can be sent using libcurl. Closes #3350
* test1201: Add a trailing `?' to the selectorLeonardo Taccari2018-12-131-2/+2
| | | | | | This verify that the `?' in the selector is kept as is. Verifies the fix in #3370
* cookies: leave secure cookies aloneDaniel Gustafsson2018-12-135-22/+89
| | | | | | | | | | | Only allow secure origins to be able to write cookies with the 'secure' flag set. This reduces the risk of non-secure origins to influence the state of secure origins. This implements IETF Internet-Draft draft-ietf-httpbis-cookie-alone-01 which updates RFC6265. Closes #2956 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* urlapi: Fix port parsing of eol colonDaniel Gustafsson2018-12-121-0/+8
| | | | | | | | | A URL with a single colon without a portnumber should use the default port, discarding the colon. Fix, add a testcase and also do little bit of comment wordsmithing. Closes #3365 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* test1519: use lib1518 and test CURLINFO_REDIRECT_URL moreDaniel Stenberg2018-12-122-3/+63
|
* Curl_follow: extract the Location: header field unvalidatedDaniel Stenberg2018-12-124-2/+141
| | | | | | | | | | | ... when not actually following the redirect. Otherwise we return error for this and an application can't extract the value. Test 1518 added to verify. Reported-by: Pavel Pavlov Fixes #3340 Closes #3364
* tests: add urlapi unittestDaniel Gustafsson2018-12-114-2/+157
| | | | | | | | | | This adds a new unittest intended to cover the internal functions in the urlapi code, starting with parse_port(). In order to avoid name collisions in debug builds, parse_port() is renamed Curl_parse_port() since it will be exported. Reviewed-by: Daniel Stenberg <daniel@haxx.se> Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
* http: fix HTTP auth to include query in URIJay Satiro2018-12-112-1/+76
| | | | | | | | | | - Include query in the path passed to generate HTTP auth. Recent changes to use the URL API internally (46e1640, 7.62.0) inadvertently broke authentication URIs by omitting the query. Fixes https://github.com/curl/curl/issues/3353 Closes #3356
* test329: verify cookie max-age=0 immediate expiryDaniel Stenberg2018-12-092-1/+71
|
* test328: verify Content-Encoding: noneDaniel Stenberg2018-11-282-1/+56
| | | | | | Because of issue #3315 Closes #3317
* cookies: create the cookiejar even if no cookies to saveDaniel Stenberg2018-11-233-2/+79
| | | | | | | | | | | Important for when the file is going to be read again and thus must not contain old contents! Adds test 327 to verify. Reported-by: daboul on github Fixes #3299 Closes #3300
* snprintf: renamed and we now only use msnprintf()Daniel Stenberg2018-11-2331-201/+212
| | | | | | | | | | | The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
* test: update test20/1322 for eglibc bug workaroundTobias Hintze2018-11-222-2/+2
| | | | | | | | | | | | The tests 20 and 1322 are using getaddrinfo of libc for resolving. In eglibc-2.19 there is a memory leakage and invalid free bug which surfaces in some special circumstances (PF_UNSPEC hint with invalid or non-existent names). The valgrind runs in testing fail in these situations. As the tests 20/1322 are not specific on either protocol (IPv4/IPv6) this commit changes the hints to IPv4 protocol by passing `--ipv4` flag on the tests' command line. This prevents the valgrind failures.
* impacket: add LICENSEDaniel Stenberg2018-11-191-0/+84
| | | | | | | | | | | The license for the impacket package was not in our tree. Imported now from upstream's https://github.com/SecureAuthCorp/impacket/blob/master/LICENSE Reported-by: infinnovation-dev on github Fixes #3276 Closes #3277
* tests: disable SO_EXCLUSIVEADDRUSE for stunnel on WindowsMarc Hoersken2018-11-151-0/+5
| | | | | | | SO_EXCLUSIVEADDRUSE is on by default on Vista or newer, but does not work together with SO_REUSEADDR being on. The default changes were made with stunnel 5.34 and 5.35.
* setopt: add CURLOPT_CURLUJim Fuller2018-11-094-2/+132
| | | | | | Allows an application to pass in a pre-parsed URL via a URL handle. Closes #3227
* curl: add %{stderr} and %{stdout} for --write-outFrank Gevaerts2018-11-072-1/+63
| | | | Closes #3115
* urlapi: only skip encoding the first '=' with APPENDQUERY setDaniel Stenberg2018-11-071-1/+1
| | | | | | | | | APPENDQUERY + URLENCODE would skip all equals signs but now it only skip encoding the first to better allow "name=content" for any content. Reported-by: Alexey Melnichuk Fixes #3231 Closes #3231
* url: a short host name + port is not a schemeDaniel Stenberg2018-11-066-43/+29
| | | | | | | | | | | | | | | | | | | The function identifying a leading "scheme" part of the URL considered a few letters ending with a colon to be a scheme, making something like "short:80" to become an unknown scheme instead of a short host name and a port number. Extended test 1560 to verify. Also fixed test203 to use file_pwd to make it get the correct path on windows. Removed test 2070 since it was a duplicate of 203. Assisted-by: Marcel Raad Reported-by: Hagai Auro Fixes #3220 Fixes #3233 Closes #3223 Closes #3235
* netrc: don't ignore the login name specified with "--user"Michael Kaufmann2018-11-051-13/+38
| | | | | | | | | | | | - for "--netrc", don't ignore the login/password specified with "--user", only ignore the login/password in the URL. This restores the netrc behaviour of curl 7.61.1 and earlier. - fix the documentation of CURL_NETRC_REQUIRED - improve the detection of login/password changes when reading .netrc - don't read .netrc if both login and password are already set Fixes #3213 Closes #3224
* unittest: make 1652 stable across collationsDaniel Gustafsson2018-11-051-2/+2
| | | | | | | | | | | | The previous coding used a format string whose output depended on the current locale of the environment running the test. Since the gist of the test is to have a format string, with the actual formatting being less important, switch to a more stable formatstring with decimals. Reported-by: Marcel Raad Closes #3234 Reviewed-by: Daniel Stenberg <daniel@haxx.se> Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
* Revert "url: a short host name + port is not a scheme"Daniel Stenberg2018-11-051-3/+0
| | | | | | | This reverts commit 226cfa8264cd979eff3fd52c0f3585ef095e7cf2. This commit caused test failures on appveyor/windows. Work on fixing them is in #3235.
* symbols-in-versions: add missing CURLU_ symbolsDaniel Stenberg2018-11-041-1/+3
| | | | | | | | ...and fix symbol-scan.pl to also scan urlapi.h Reported-by: Alexey Melnichuk Fixes #3226 Closes #3230
* infof: clearly indicate truncationDaniel Gustafsson2018-11-034-2/+161
| | | | | | | | | | | | | | | | | | The internal buffer in infof() is limited to 2048 bytes of payload plus an additional byte for NULL termination. Servers with very long error messages can however cause truncation of the string, which currently isn't very clear, and leads to badly formatted output. This appends a "...\n" (or just "..." in case the format didn't with a newline char) marker to the end of the string to clearly show that it has been truncated. Also include a unittest covering infof() to try and catch any bugs introduced in this quite important function. Closes #3216 Reviewed-by: Daniel Stenberg <daniel@haxx.se> Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
* url: a short host name + port is not a schemeDaniel Stenberg2018-11-031-0/+3
| | | | | | | | | | | | The function identifying a leading "scheme" part of the URL considered a few letters ending with a colon to be a scheme, making something like "short:80" to become an unknown scheme instead of a short host name and a port number. Extended test 1560 to verify. Reported-by: Hagai Auro Fixes #3220 Closes #3223
* URL: fix IPv6 numeral address parserDaniel Stenberg2018-11-031-0/+9
| | | | | | | | Regression from 46e164069d1a52. Extended test 1560 to verify. Reported-by: tpaukrt on github Fixes #3218 Closes #3219
* Curl_follow: accept non-supported schemes for "fake" redirectsDaniel Stenberg2018-11-022-1/+59
| | | | | | | | | | When not actually following the redirect and the target URL is only stored for later retrieval, curl always accepted "non-supported" schemes. This was a regression from 46e164069d1a5230. Reported-by: Brad King Fixes #3210 Closes #3215
* axtls: removedDaniel Stenberg2018-11-013-21/+2
| | | | | | | | | | As has been outlined in the DEPRECATE.md document, the axTLS code has been disabled for 6 months and is hereby removed. Use a better supported TLS library! Assisted-by: Daniel Gustafsson Closes #3194