summaryrefslogtreecommitdiff
path: root/tests/libtest
Commit message (Collapse)AuthorAgeFilesLines
* connection: never reuse CONNECT_ONLY conectionsDaniel Stenberg2019-02-191-62/+42
| | | | | | | | and make CONNECT_ONLY conections never reuse any existing ones either. Reported-by: Pavel Löbl Bug: https://curl.haxx.se/mail/lib-2019-02/0064.html Closes #3586
* gssapi: fix deprecated header warningsDaniel Stenberg2019-02-141-9/+9
| | | | | | Heimdal includes on FreeBSD spewed out lots of them. Less so now. Closes #3566
* test1558: verify CURLINFO_PROTOCOL on file:// transferDaniel Stenberg2019-01-102-0/+69
| | | | | | Attempt to reproduce issue #3444. Closes #3447
* curl_multi_remove_handle() don't block terminating c-ares requestsBrad Spencer2019-01-072-1/+124
| | | | | | | | | 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-041-1/+1
| | | | 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
* http: minor whitespace cleanup from f464535bDaniel Stenberg2018-12-141-1/+0
|
* http: Implement trailing headers for chunked transfersAyoub Boudhar2018-12-143-0/+112
| | | | | | | | | | | | | 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
* Curl_follow: extract the Location: header field unvalidatedDaniel Stenberg2018-12-122-1/+78
| | | | | | | | | | | ... 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
* snprintf: renamed and we now only use msnprintf()Daniel Stenberg2018-11-2320-115/+121
| | | | | | | | | | | 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
* setopt: add CURLOPT_CURLUJim Fuller2018-11-092-1/+81
| | | | | | Allows an application to pass in a pre-parsed URL via a URL handle. Closes #3227
* 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-061-0/+14
| | | | | | | | | | | | | | | | | | | 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
* 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.
* 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
* CMake: suppress MSVC warning C4127 for libtestMarcel Raad2018-10-051-0/+4
| | | | It's issued by older Windows SDKs (prior to version 8.0).
* cmake: fixed path used in generation of docs/tests during curl build through ↵Sergei Nikulov2018-09-281-2/+2
| | | | add_subdicectory(...)
* Curl_dedotdotify(): always nul terminate returned string.Even Rouault2018-09-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes potential out-of-buffer access on "file:./" URL $ valgrind curl "file:./" ==24516== Memcheck, a memory error detector ==24516== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==24516== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==24516== Command: /home/even/install-curl-git/bin/curl file:./ ==24516== ==24516== Conditional jump or move depends on uninitialised value(s) ==24516== at 0x4C31F9C: strcmp (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==24516== by 0x4EBB315: seturl (urlapi.c:801) ==24516== by 0x4EBB568: parseurl (urlapi.c:861) ==24516== by 0x4EBC509: curl_url_set (urlapi.c:1199) ==24516== by 0x4E644C6: parseurlandfillconn (url.c:2044) ==24516== by 0x4E67AEF: create_conn (url.c:3613) ==24516== by 0x4E68A4F: Curl_connect (url.c:4119) ==24516== by 0x4E7F0A4: multi_runsingle (multi.c:1440) ==24516== by 0x4E808E5: curl_multi_perform (multi.c:2173) ==24516== by 0x4E7558C: easy_transfer (easy.c:686) ==24516== by 0x4E75801: easy_perform (easy.c:779) ==24516== by 0x4E75868: curl_easy_perform (easy.c:798) Was originally spotted by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10637 Credit to OSS-Fuzz Closes #3039
* whitespace fixesViktor Szakats2018-09-2342-45/+2
| | | | | | | | | | | - replace tabs with spaces where possible - remove line ending spaces - remove double/triple newlines at EOF - fix a non-UTF-8 character - cleanup a few indentations/line continuations in manual examples Closes https://github.com/curl/curl/pull/3037
* urlapi: fix support for address scope in IPv6 numerical addressesDaniel Stenberg2018-09-211-0/+3
| | | | Closes #3024
* urlapi: document the error codes, remove two unused onesDaniel Stenberg2018-09-191-20/+20
| | | | | Assisted-by: Daniel Gustafsson Closes #3019
* urlapi: add CURLU_GUESS_SCHEME and fix hostname acceptanceDaniel Stenberg2018-09-191-1/+25
| | | | | | | | | | | | | | | In order for this API to fully work for libcurl itself, it now offers a CURLU_GUESS_SCHEME flag that makes it "guess" scheme based on the host name prefix just like libcurl always did. If there's no known prefix, it will guess "http://". Separately, it relaxes the check of the host name so that IDN host names can be passed in as well. Both these changes are necessary for libcurl itself to use this API. Assisted-by: Daniel Gustafsson Closes #3018
* libtest: Add chkdecimalpoint to .gitignoreRikard Falkeborn2018-09-151-0/+1
| | | | Closes #2998
* URL-APIDaniel Stenberg2018-09-083-0/+769
| | | | | | | See header file and man pages for API. All documented API details work and are tested in the 1560 test case. Closes #2842
* lib1522: fix curl_easy_setopt argument typeMarcel Raad2018-08-241-1/+1
| | | | CURLOPT_POSTFIELDSIZE is a long option.
* test1148: disable if decimal separator is not pointMarcel Raad2018-08-213-0/+51
| | | | | | | | | Modifying the locale with environment variables doesn't work for native Windows applications. Just disable the test in this case if the decimal separator is something different than a point. Use a precheck with a small C program to achieve that. Closes https://github.com/curl/curl/pull/2786
* curl-compilers: enable -Wbad-function-cast on GCCMarcel Raad2018-08-211-1/+4
| | | | | | | This warning used to be enabled only for clang as it's a bit stricter on GCC. Silence the remaining occurrences and enable it on GCC too. Closes https://github.com/curl/curl/pull/2747
* CURLINFO_SIZE_UPLOAD: fix missing counter updateDaniel Stenberg2018-08-112-1/+91
| | | | | | | | Adds test 1522 for verification. Reported-by: cjmsoregan Fixes #2847 Closes #2864
* lib1502: fix memory leak in torture testDaniel Stenberg2018-08-101-0/+2
| | | | | | Reported-by: Marcel Raad Fixes #2861 Closes #2863
* test1531: Add timeoutRikard Falkeborn2018-08-091-1/+10
| | | | | | | Previously, the macro TEST_HANG_TIMEOUT was unused, but since there is looping going on, we might as well add timing instead of removing it. Closes #2853
* test1540: Remove unused macro TEST_HANG_TIMEOUTRikard Falkeborn2018-08-091-2/+0
| | | | | | | The macro has never been used, and it there is not really any place where it would make sense to add timing checks. Closes #2852
* general: fix printf specifiersRikard Falkeborn2018-08-011-1/+1
| | | | Closes #2818
* CMake: Update scripts to use consistent styleRuslan Baratov2018-07-171-2/+2
| | | | | Closes #2727 Reviewed-by: Sergei Nikulov
* multi: always do the COMPLETED procedure/stateDaniel Stenberg2018-07-111-5/+10
| | | | | | | | | | | It was previously erroneously skipped in some situations. libtest/libntlmconnect.c wrongly depended on wrong behavior (that it would get a zero timeout) when no handles are "running" in a multi handle. That behavior is no longer present with this fix. Now libcurl will always return a -1 timeout when all handles are completed. Closes #2733
* multi: fix crash due to dangling entry in connect-pending listJavier Blazquez2018-06-232-1/+67
| | | | | Fixes #2677 Closes #2679
* cppcheck: fix warningsMarian Klymov2018-06-119-26/+17
| | | | | | | | | | | | | - Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
* tests/libtests/Makefile.am: Add lib1521.c to CLEANFILESRikard Falkeborn2018-06-061-0/+2
| | | | | | This removes the generated lib1521.c when running make clean. Closes #2633
* tests/libtest: Add lib1521 to nodist_SOURCESRikard Falkeborn2018-06-063-5/+6
| | | | | | | | | | | Since 467da3af0, lib1521.c is generated instead of checked in. According to the commit message, the intention was to remove it from the tarball as well. However, it is still present when running make dist. To remove it, add it to nodist_lib1521_SOURCES. This also means there is no need for the manually added dist-rule in the Makefile. Also update CMakelists.txt to handle the fact that we now may have nodist_SOURCES.
* tests/libtest/.gitignore: follow-up fix to ignore lib5* tooDaniel Stenberg2018-05-311-1/+1
|
* tests: update .gitignore for libtestsRikard Falkeborn2018-05-311-6/+2
| | | | Closes #2624
* cmake: set -d postfix for debug builds if not specifiedSergei Nikulov2018-05-241-6/+0
| | | | | | using -DCMAKE_DEBUG_POSTFIX explicitly fixes #2121, obsoletes #2384
* http resume: skip body if http code 416 (range error) is ignored.Patrick Monnerat2018-05-222-0/+167
| | | | | | | | | | | | This avoids appending error data to already existing good data. Test 92 is updated to match this change. New test 1156 checks all combinations of --range/--resume, --fail, Content-Range header and http status code 200/416. Fixes #1163 Reported-By: Ithubg on github Closes #2578
* checksrc: make sure sizeof() is used *with* parenthesesDaniel Stenberg2018-05-214-7/+7
| | | | | | ... and unify the source code to adhere. Closes #2563
* stub_gssapi: fix numerous 'unused parameter' warningsDaniel Stenberg2018-05-181-2/+50
| | | | follow-up to d9e92fd9fd1d
* getinfo: add microsecond precise timers for various intervalsPhilip Prindeville2018-05-171-18/+32
| | | | | | | | | | | | | | | | | Provide a set of new timers that return the time intervals using integer number of microseconds instead of floats. The new info names are as following: CURLINFO_APPCONNECT_TIME_T CURLINFO_CONNECT_TIME_T CURLINFO_NAMELOOKUP_TIME_T CURLINFO_PRETRANSFER_TIME_T CURLINFO_REDIRECT_TIME_T CURLINFO_STARTTRANSFER_TIME_T CURLINFO_TOTAL_TIME_T Closes #2495
* tests/libtest/Makefile: Do not unconditionally add gcc-specific flagsDagobert Michelsen2018-05-161-1/+1
| | | | | | The warning flag leads e.g. Sun Studio compiler to bail out. Closes #2576
* tests: Fix format specifiersRikard Falkeborn2018-05-145-8/+8
|
* checksrc: force indentation of lines after an elseDaniel Gustafsson2018-04-271-1/+1
| | | | | | | | This extends the INDENTATION case to also handle 'else' statements and require proper indentation on the following line. Also fixes the offending cases found in the codebase. Closes #2532
* duphandle: make sure CURLOPT_RESOLVE is duplicated fine tooDaniel Stenberg2018-04-121-1/+11
| | | | | | | | Verified in test 1502 now Fixes #2485 Closes #2486 Reported-by: Ernst Sjöstrand