1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
Commit Graph

2420 Commits

Author SHA1 Message Date
Daniel Stenberg
81b41095ef Curl_follow: handle redirects to "//hostname/path" 2011-09-20 11:16:40 +02:00
warp kawada
aff70e2e95 Curl_add_custom_headers: support headers with no data
A custom HTTP header ending in a semicolon instead of a colon
will be treated as a header to be added without any data
portion.
2011-09-13 16:17:21 -07:00
Yang Tse
0413e24891 runtests.pl: replace TAB with spaces 2011-09-10 01:23:21 +02:00
Yang Tse
be8e68494c test harness: revert needless commit 0a5bbb2ac1
https, ftps and ssh servers allowed start up time back to previous values
2011-09-10 01:14:52 +02:00
Yang Tse
28d09cb0f5 lib582.c: fix segfault triggered when torture testing test case 582 2011-09-08 01:22:47 +02:00
Yang Tse
6539047694 test case 583: ensure that test failures don't go unnoticed - follow-up 2011-09-06 19:59:42 +02:00
Yang Tse
774ad4e31d test suite: libtest header inclusion cleanup - follow-up
Adjust tests/libtest/Makefile.inc and remove a couple of unused headers from
tests/libtest/lib583.c
2011-09-06 18:11:11 +02:00
Yang Tse
f764da8afb test case 583: ensure that test failures don't go unnoticed 2011-09-06 17:56:39 +02:00
Yang Tse
c8ba8740b9 test suite: libtest header inclusion cleanup
Added missing memoryTracking to test cases 560 and 583. If this triggers
leak detection on these, it only means that previously it was going unnoticed.
2011-09-06 17:47:54 +02:00
Yang Tse
a50210710a fix bool variables checking and assignment 2011-09-05 20:46:09 +02:00
Yang Tse
eb44ac0138 test suite: use test case specific netrc file names 2011-09-05 12:39:50 +02:00
Yang Tse
6b75d2c2df fix a bunch of MSVC compiler warnings 2011-09-03 16:07:09 +02:00
Yang Tse
0a5bbb2ac1 test harness: https, ftps and ssh servers allowed start up time increased 33% 2011-09-01 22:21:57 +02:00
Yang Tse
437848d754 test harness: fix detection of test harness client knownhosts file
Regenerate curl's tests client knownhosts file also when, somehow,
this file is empty.
2011-08-31 19:59:26 +02:00
Yang Tse
38fff918f9 test harness: fix detection of test harness host and client key files
Regenerate curl's tests host and client key files also when, somehow,
any of these files are empty.
2011-08-31 18:16:14 +02:00
Kamil Dudka
3445fa2e3f tests: break busy loops in tests 502, 555, and 573 2011-08-29 15:14:39 +02:00
Yang Tse
b976d108f1 NTLM_WB: final congruency naming adjustments
Configure script option --enable-wb-ntlm-auth renamed to --enable-ntlm-wb
Configure script option --disable-wb-ntlm-auth renamed to --disable-ntlm-wb

Preprocessor symbol WINBIND_NTLM_AUTH_ENABLED renamed to NTLM_WB_ENABLED
Preprocessor symbol WINBIND_NTLM_AUTH_FILE renamed to NTLM_WB_FILE

Test harness env var CURL_NTLM_AUTH renamed to CURL_NTLM_WB_FILE

Static function wb_ntlm_close renamed to ntlm_wb_cleanup
Static function wb_ntlm_initiate renamed to ntlm_wb_init
Static function wb_ntlm_response renamed to ntlm_wb_response
2011-08-27 06:31:18 +02:00
Yang Tse
b4f6319cf7 NTLM single-sign on adjustments (XI)
Feature string literal NTLM_SSO renamed to NTLM_WB.
Preprocessor symbol USE_NTLM_SSO renamed to WINBIND_NTLM_AUTH_ENABLED.
curl's 'long' option 'ntlm-sso' renamed to 'ntlm-wb'.
Fix some comments to make clear that this is actually a NTLM delegation.
2011-08-27 01:33:35 +02:00
Yang Tse
fd00b382b2 base64: fix Curl_base64_encode and Curl_base64_decode interfaces
Previous interfaces for these libcurl internal functions did not allow to tell
apart a legitimate zero size result from an error condition. These functions
now return a CURLcode indicating function success or otherwise specific error.
Output size is returned using a pointer argument.

All usage of these two functions, and others closely related, has been adapted
to the new interfaces. Relative error and OOM handling adapted or added where
missing. Unit test 1302 also adapted.
2011-08-24 08:10:30 +02:00
Yang Tse
a659cc4794 runtests.pl: option -gw for single test windowed debugging (where possible) 2011-08-21 19:25:35 +02:00
Yang Tse
838dd8f594 MemoryTracking: adjust initialization calling - followup
Fix macro definition
2011-08-21 06:10:52 +02:00
Yang Tse
aaab5fa299 MemoryTracking: adjust initialization calling
Calling of curl_memdebug() was still done with a pending free()
2011-08-20 17:26:42 +02:00
Daniel Stenberg
7b054a42aa test573: fix the keywords 2011-08-19 00:15:37 +02:00
Daniel Stenberg
ef2059a44c test572: fixed
Two problems were fixed:

GET_PARAMETER responses that have no body must be 204 response or
properly set length to 0.

One of the <data> sections had the wrong content-length for its
GET_PARAMETER response.

Enabled test 572 again.
2011-08-15 22:40:28 +02:00
Yang Tse
6a7ce5cc76 tests: disable #572 2011-08-15 00:20:32 +02:00
Daniel Stenberg
7c21c1c4f9 cookie parser: handle 'secure='
There are two keywords in cookie headers that don't follow the regular
name=value style: secure and httponly. Still we must support that they
are written like 'secure=' and then treat them as if they were written
'secure'. Test case 31 was much extended by Rob Ward to test this.

Bug: http://curl.haxx.se/bug/view.cgi?id=3349227
Reported by: "gnombat"
2011-08-09 14:02:05 +02:00
Daniel Stenberg
45d883d88d CURLFORM_BUFFER: insert filename as documented
A regression where CURLFORM_BUFFER stopped to properly insert the file
name part in the formpart. Bug introduced in commit f851f76857.

Added CURLFORM_BUFFER use to test 554 to verify this.

Bug: http://curl.haxx.se/mail/lib-2011-07/0176.html
Reported by: Henry Ludemann
2011-08-08 18:45:03 +02:00
Daniel Stenberg
afe88d85f4 test710: verify that --proxy socks5://hostname works 2011-08-05 00:46:59 +02:00
Daniel Stenberg
75fa3d2d6e test709: HTTP GET via SOCKS5 set in environment 2011-08-05 00:28:03 +02:00
Daniel Stenberg
86b50a1fe5 test1313: test content-disposition with uneven quotes 2011-08-04 23:25:55 +02:00
Daniel Stenberg
519d0c0dd2 -J: support ';' in quoted file names
Content-disposition headers can provide file names with semicolons which
previously would be cut off at that point.

Added test case 1311 and 1312 to verify -J.

Bug: http://curl.haxx.se/bug/view.cgi?id=3375603
Reported by: Peter Hjalmarsson
2011-08-04 17:48:45 +02:00
Daniel Stenberg
d2c22411af getpart.pm: when no part match, return blank when section ends 2011-08-04 17:36:31 +02:00
Daniel Stenberg
c4142034ff runtests.pl: support option=no-include 2011-08-04 17:36:00 +02:00
Yang Tse
10a0bed485 NTLM single-sign on adjustments (VIII)
Use preprocessor symbols WINBIND_NTLM_AUTH_ENABLED and WINBIND_NTLM_AUTH_FILE
for Samba's winbind daemon ntlm_auth helper code implementation and filename.

Retain preprocessor symbol USE_NTLM_SSO for NTLM single-sign-on feature
availability implementation independent.

For test harness, prefix NTLM_AUTH environment vars with CURL_

Refactor and rename configure option --with-ntlm-auth to --enable-wb-ntlm-auth[=FILE]
2011-07-31 20:44:41 +02:00
Dan Fandrich
cc3e01cfae Renumbered test2005 to test1310
The 20xx range is for multiple sequential tests.
2011-07-29 12:35:52 -07:00
Yang Tse
bcbac913d6 socketpair() usage tracking to allow fd leak detection 2011-07-29 13:27:10 +02:00
Yang Tse
5cdbfa1837 fix compiler warning 2011-07-29 13:27:08 +02:00
Yang Tse
35051d274f NTLM single-sign on adjustments (VI)
Fix compiler warning
2011-07-28 22:47:42 +02:00
Dan Fandrich
435e2bc757 Removed an extraneous \n that violated the SSO daemon protocol
This caused fake_ntlm to abort due to an invalid command
causing sporadic test 2005 failures.
2011-07-28 12:41:44 -07:00
Yang Tse
99848d3dab NTLM single-sign on adjustments (V)
Enhance test harness fake_ntlm logging upon invalid input.
2011-07-28 21:12:41 +02:00
Yang Tse
dddf9aa610 NTLM single-sign on adjustments (IV)
Fix compiler warning
2011-07-27 20:10:02 +02:00
Yang Tse
6ac4eeab2f NTLM single-sign on adjustments (II)
Ensure test harness fake_ntlm main function can properly handle arguments.
2011-07-27 19:04:55 +02:00
Yang Tse
8350fb8f2f NTLM single-sign on adjustments (I)
Use fake_ntlm absolute filename in NTLM_AUTH environment variable for test
2005 definition.
2011-07-27 18:58:21 +02:00
Dan Fandrich
cfcca89b76 Fixed test 2005 to work in out-of-tree builds
Also, set the test number in the test data file so fake_ntlm can
be reused in future tests.
2011-07-26 12:48:16 -07:00
Yang Tse
78bbd0eecf fix compiler warning 2011-07-26 19:42:16 +02:00
Yang Tse
ef2176109f errno.h inclusion conditionally done in setup_once.h 2011-07-24 04:39:43 +02:00
Daniel Stenberg
3f9b4afdfd http error response: stop sending when error is received
When libcurl has said to the server that there's a POST or PUT coming
(with a content-length and all) it has to either deliver that amount of
data or it needs to close the connection before trying a second request.

Adds test case 1129, 1130 and 1131

The bug report is about when used with 100-continue, but the change is
more generic.

Bug: http://curl.haxx.se/mail/lib-2011-06/0191.html
Reported by: Steven Parkes
2011-07-20 00:08:41 +02:00
Daniel Stenberg
0ae15092d4 test2005: require a debug build 2011-07-19 23:50:34 +02:00
Daniel Stenberg
b9313af838 runtests: add 'debug' as a feature a test can require 2011-07-19 23:49:40 +02:00
Daniel Stenberg
177fd0a14c gitignore: ignore fake_ntlm 2011-07-18 23:49:31 +02:00
Mandy Wu
aa26c2751a test2005: verify ntlm single-signon 2011-07-18 23:48:53 +02:00
Daniel Stenberg
650a504b2f sws: don't enable pipelining for requests with content-length
Log texts also modified and some white space edits
2011-07-17 00:39:23 +02:00
Daniel Stenberg
9c1f50c583 runtests: ignore the 'all_proxy' environment variable as well
We should probably also make sure that [protocol]_proxy for all possible
protocols libcurl supports are unset.
2011-07-14 11:04:00 +02:00
Daniel Stenberg
c7a4df16e0 sws: allow multiple commands in <servercmd> 2011-07-03 19:15:06 +02:00
Daniel Stenberg
fb48e2050b libtests: stop checking for CURLM_CALL_MULTI_PERFORM
CURLM_CALL_MULTI_PERFORM stopped being a valid return code from
curl_multi_perform back in 7.20.0. All the libcurl tests are ajusted to
this and no longer check for this return code. Makes them simpler.
2011-06-27 16:01:41 +02:00
Dan Fandrich
78480892cd Fixed test 1300 to pass the memory torture test 2011-06-24 12:33:30 -07:00
Dan Fandrich
17a2d70dc4 Display notes from setup file in testcurl.pl
Autobuild submitters can use this to add some text to their
setup files to describe issues they've found with the build
or tests. This could include laying blame on test failures on
network issues or dependent libraries, explaining away compiler
warnings or providing any additional information that could be
useful to people reviewing and investigating problems with the
publicly available autobuild logs.  Note that persistent test
failures that are not issues with curl itself should normally be
fixed by excluding them from the test run instead.

This is an entirely optional field that is not entered by the
user the first time a new build is created.
2011-06-23 22:49:28 -07:00
Dan Fandrich
43ce5580a8 Added a leap second test to test517 2011-06-23 21:20:29 -07:00
Daniel Stenberg
0215f7cb4d runtests.pl: warn if a test is explicitly disabled
Just to make sure a user is aware of it.
2011-06-23 23:10:00 +02:00
Daniel Stenberg
57d51be60c parsedate: detect more invalid dates better 2011-06-23 13:49:29 +02:00
Ori Avtalion
af6dcc92d5 [pop3] remove extra space in LIST command
Some servers, e.g. mail.bezeqint.net:110, consider it a syntax error
2011-06-21 18:12:05 +03:00
Amr Shahin
c9f16e67ef unitteset: Curl_llist_move
adding unit test for Curl_llist_move, documenting unit-tested functions
in llist.c, changing unit-test to unittest, replacing assert calls with
abort_unless calls
2011-06-19 22:22:49 +02:00
Daniel Stenberg
f851f76857 CURLFORM_STREAM: acknowledge CURLFORM_FILENAME
The CURLFORM_STREAM is documented to only insert a file name (and thus
look like a file upload) in the part if CURLFORM_FILENAME is set, but in
reality it always inserted a filename="" and if CURLFORM_FILENAME wasn't
set, it would insert insert rubbish (or possibly crash).

This is now fixed to work as documented, and test 554 has been extended
to verify this.

Reported by: Sascha Swiercy
Bug: http://curl.haxx.se/mail/lib-2011-06/0070.html
2011-06-17 22:23:42 +02:00
Daniel Stenberg
0aedccc18a curl_formget: fix FILE * leak
Properly deal with the fact that the last fread() call most probably is
a short read, and when using callbacks in fact all calls can be short
reads. No longer consider a file read done until it returns a 0 from the
read function.

Reported by: Aaron Orenstein
Bug: http://curl.haxx.se/mail/lib-2011-06/0048.html
2011-06-13 22:32:00 +02:00
Dan Fandrich
a6fa7fc38e Added http as a dependency of test 1308 2011-06-11 17:02:37 -07:00
Daniel Stenberg
b122f8be61 test1309: added to the dist 2011-06-12 00:10:51 +02:00
Daniel Stenberg
950fb3efcc write: add return code checks when used
These were just warnings in test code but it still makes it nicer to not
generate them.
2011-06-11 23:01:09 +02:00
Dan Fandrich
b688f2c260 Fixed test 1309 to pass the torture test
Removing dynamic allocations also simplifies the test.
2011-06-11 00:10:09 -07:00
Daniel Stenberg
c4dd8df081 splay: add unit tests
The test code that was #ifdef'ed in the code was converted into unit
tests in test case 1309. I also removed the #if 0'ed code from splay.c
2011-06-10 20:19:35 +02:00
Daniel Stenberg
36a22f9074 unit test formpost: added test case 1308
This is a few first rather basic tests of curl_formadd() and
curl_formget(). Should serve as building blocks to add more variations
to the test.
2011-06-10 12:03:29 +02:00
Daniel Stenberg
c0b9dd27b5 HTTP time condition: force closure for 200 OK
When a time condition isn't met, so that no body is delivered to the
application even though a 2xx response is being read from the server, we
must close the connection to avoid a re-use of the connection to be
completely tricked.

Added test 1128 to verify.
2011-06-07 13:40:11 +02:00
Yang Tse
2a31dde76c unit tests: attempt to fix linkage issue 2011-06-02 22:26:01 +02:00
Yang Tse
aa76dec33a unit tests: more build adjustments 2011-06-01 21:40:09 +02:00
Yang Tse
685359d4c3 makefile: avoid preprocessor definition usage when linking 2011-06-01 14:43:25 +02:00
Daniel Stenberg
3d64ed25df testcurl.pl: allow configure args to use '=' 2011-05-31 13:35:26 +02:00
Yang Tse
f5d78919af distribution: Fix EXTRA_DIST letter case 2011-05-27 13:37:20 +02:00
Yang Tse
5d39dea3b3 compiler warning: fix
Fix compiler warning: variable was set but never used

Fix compiler warning: clobber ignored
2011-05-26 12:40:04 +02:00
Yang Tse
9f390a356e unit tests: build adjustment
Also define UNITTESTS macro when building unit test sources.

Fixing compiler warning: external definition with no prior declaration
2011-05-25 20:24:03 +02:00
Yang Tse
9b5343054a unit tests: README, adjust header inclusion order 2011-05-24 21:23:52 +02:00
Yang Tse
ec33742d1b compiler warning: fix
Fix compiler warning: external definition with no prior declaration
2011-05-24 17:35:08 +02:00
Yang Tse
2ea31b0e6f compiler warning: fix
Fix compiler warning: external definition with no prior declaration
2011-05-24 17:29:50 +02:00
Yang Tse
de70ddb749 compiler warning: fix
Fix compiler warning: argument is incompatible with corresponding format
string conversion
2011-05-24 17:24:59 +02:00
Yang Tse
8b849265d8 compiler warning: fix
Fix compiler warning: enumerated type mixed with another type
2011-05-21 14:39:42 +02:00
Yang Tse
02f3ff3b0a unit tests: adjust header inclusion order
Additionally, prevent multiple inclusions of curl_config.h
2011-05-21 13:22:11 +02:00
Yang Tse
b578534508 tests: verify OPEN/CLOSESOCKETFUNCTION
Test 585: Fix opensocket return type, and avoid function name clash.
2011-05-19 22:28:28 +02:00
Daniel Stenberg
873d70a6d8 tests: verify OPEN/CLOSESOCKETFUNCTION
Test 585 and 586 were added. Using a modified lib500.c
2011-05-18 22:56:46 +02:00
Daniel Stenberg
0c8e6f598a tests: added HTTP If-Modified-Since tests
Added test 1126 and 1127 to verify curl's behaviour when If-Modified-Since
is used and a 200 is returned.

The list of test cases in Makefile.am is now sorted numerically.
2011-05-13 08:55:15 +02:00
Daniel Stenberg
3b1b26578f proxy: allow socks:// prefix in proxy string
Inspired by a patch from OB.Conseil. Added test case 708 to verify.
2011-04-28 15:08:09 +02:00
Daniel Stenberg
4a42e5cdaa multi-socks: fix connect to proxy
When connecting to a socks or similar proxy we do the proxy handshake at
once when we know the TCP connect is completed and we only consider the
"connection" complete after the proxy handshake. This fixes test 564
which is now no longer considered disabled.

Reported by: Dmitri Shubin
Bug: http://curl.haxx.se/mail/lib-2011-04/0127.html
2011-04-28 10:06:49 +02:00
Dan Fandrich
d8373cb992 Fixed test 1023 when using daily snapshots 2011-04-21 14:47:35 -07:00
Dan Fandrich
7872c8d5a2 Fixed closing test tag 2011-04-20 16:51:44 -07:00
Dan Fandrich
1b6df743f6 Fixed test 1022 when using daily snapshots 2011-04-20 14:11:12 -07:00
Daniel Stenberg
8e4fb01e64 transfer-encoding: added new option and cmdline
Added CURLOPT_TRANSFER_ENCODING as the option to set to request Transfer
Encoding in HTTP requests (if built zlib enabled). I also renamed
CURLOPT_ENCODING to CURLOPT_ACCEPT_ENCODING (while keeping the old name
around) to reduce the confusion when we have to encoding options for
HTTP.

--tr-encoding is now the new command line option for curl to request
this, and thus I updated the test cases accordingly.
2011-04-18 19:46:21 +02:00
Daniel Stenberg
9d191a6a40 TE: do the Connection: header
When TE: is inserted in the request, we must add a "Connection: TE" as
well to be HTTP 1.1 compliant. If a custom Connection: header is passed
in, we must use that and only append TE to it. Test case 1125 verifies
TE: + custom Connection:.
2011-04-18 19:46:21 +02:00
Daniel Stenberg
be973b6f91 test1124: verify gzip AND chunked transfer-encoding 2011-04-18 19:46:21 +02:00
Daniel Stenberg
0790b27910 HTTP: add support for gzip and deflate Transfer-Encoding
Transfer-Encoding differs from Content-Encoding in a few subtle ways,
but primarily it concerns the transfer only and not the content so when
discovered to be compressed we know we have to uncompress it. There will
only arrive compressed transfers in a response after we have requested
them with the appropriate TE: header.

Test case 1122 and 1123 verify.
2011-04-18 19:46:21 +02:00
Daniel Stenberg
82ecc85d9e curl-config: fix --version
curl-config --version didn't output the correct version string (bug
introduced in commit 0355e33b5f), and unfortunately the test
case 1022 that was supposed to check for this was broken.

This change fixes the test to detect this problem and it fixes the
output.

Bug: http://curl.haxx.se/bug/view.cgi?id=3288727
2011-04-18 09:03:12 +02:00
Chris Smowton
d54668eb00 HTTP pipelining: Fix handling of zero-length responses
Also add test case 584 for the same

Bug: http://curl.haxx.se/bug/view.cgi?id=3214223
2011-04-07 14:18:07 +02:00
Dan Fandrich
c22c258029 Changed some nonportable types 2011-04-05 22:31:45 -07:00
Daniel Stenberg
9680df4807 headers: more copyright headers added 2011-03-22 22:48:11 +01:00