Commit Graph

2198 Commits

Author SHA1 Message Date
Daniel Stenberg 7d8343934b symbols-in-version: add CURL_SOCKET_BAD
I also documented the filtering logic in the symbol-scan.pl function to
clarify why not all CURL_* symbols are included.
2010-11-09 14:20:23 +01:00
Kamil Dudka c6b97a8278 ftp: close connection as soon as ABOR has been sent
... and do not send ABOR unless really necessary.

Bug: https://bugzilla.redhat.com/649347
Reported by: Simon H.
2010-11-08 20:50:52 +01:00
Daniel Stenberg 1786950759 test: remove test 580
Test 580 is removed again for two reasons:

1) Some compilers aren't satisfied by just a data variable called 'test'
when first.o wants a function called 'test'. The Solaris compiler says
"ld: warning: symbol `test' has differing types:" while the AIX compiler
downright rejects it.

2) Test case 1119 that was added after this test is way more complete
and cover everything test 580 does and more without introducing the same
problems.
2010-11-05 11:26:26 +01:00
Dan Fandrich 96945c98d5 Allow building test 580 out of tree 2010-11-03 19:03:02 -07:00
Daniel Stenberg 1db61aca3b dist: add symbol-scan.pl to the tarball 2010-11-03 11:25:06 +01:00
Daniel Stenberg bbb6eb3aaa test1119: verify symbols-in-versions 2010-11-03 11:23:54 +01:00
Daniel Stenberg a4765b0551 runtests: allow tests written as perl scripts
If a command is set type="perl", it can now specify a perl program that will
be run instead of an ordinary curl or built tool.

A perl test automatically disables memory and valgrind debugging.
2010-11-03 11:22:46 +01:00
Daniel Stenberg 29de7dd288 symbol-scan: verifies symbols-in-versions
This new script scans for all enums and #defines used by the curl/curl.h
and curl/multi.h headers. Then it reads all symbols mentioned in
symbols-in-vesions and make sure that there's no entries missing in
there. It then proceeds to verify that the entries that
symbols-in-vesions mentions but aren't found in the sources are truly
documented as removed.

This script is used in the new test case 1119
2010-11-03 11:20:19 +01:00
Dan Fandrich 282b41c69b Added mk580.pl to the tar ball 2010-11-02 23:17:36 -07:00
Daniel Stenberg 36420330de ignore: lib580.c is generated by mk580.pl 2010-11-02 23:34:37 +01:00
Daniel Stenberg cc87913294 test: added test 580 - verifies symbols-in-versions
The new perl script mk580.pl generates a C table in a fresh source file
named lib580.c and if that compiles fine we know that the file
docs/libcurl/symbols-in-versions at least doesn't include any symbols
that are misspelled.

An additional feature would be to somehow scan curl/curl.h and compare
with symbols-in-versions to see if there are symbols missing.
2010-11-02 22:27:33 +01:00
Kamil Dudka 0c8e5f7e6a ftp: prevent server from hanging on closed data connection
Some FTP servers (e.g. Pure-ftpd) end up hanging if we close the data
connection before transferring all the requested data.  If we send ABOR
in that case, it prevents the server from hanging.

Bug: https://bugzilla.redhat.com/643656
Reported by: Pasi Karkkainen, Patrick Monnerat
2010-10-29 12:01:19 +02:00
Daniel Stenberg 98d9dc7840 URL-parsing: consider ? a divider
The URL parser got a little stricter as it now considers a ? to be a
host name divider so that the slightly sloppier URLs work too. The
problem that made me do this change was the reported problem with an URL
like: www.example.com?email=name@example.com This form of URL is not
really a legal URL (due to the missing slash after the host name) but is
widely accepted by all major browsers and libcurl also already accepted
it, it was just the '@' letter that triggered the problem now.

The side-effect of this change is that now libcurl no longer accepts the
?  letter as part of user-name or password when given in the URL, which
it used to accept (and is tested in test 191). That letter is however
mentioned in RFC3986 to be required to be percent encoded since it is
used as a divider.

Bug: http://curl.haxx.se/bug/view.cgi?id=3090268
2010-10-19 20:20:06 +02:00
Dan Fandrich 4b0c411ce6 Fixed the IPv6 host address in test1203
Reported by: Christian Weisgerber
Bug: http://curl.haxx.se/bug/view.cgi?id=3087479
2010-10-14 12:45:01 -07:00
Guenter Knauf 7e46061cac Added --noconfigure switch to testcurl.pl. 2010-10-14 00:57:36 +02:00
Daniel Stenberg 6a43ffa0d5 test: urlglob error messages have no extra newline anymore 2010-10-11 14:32:37 +02:00
Daniel Stenberg 2ae6c47d5d HTTP: remove special case for 416
It was pointed out that the special case libcurl did for 416 was
incorrect and wrong. 416 is not really different to other errors so the
response body must be handled like for other errors/http responses.

Reported by: Chris Smowton
Bug: http://curl.haxx.se/bug/view.cgi?id=3076808
2010-10-02 00:22:48 +02:00
Dan Fandrich 15622e69a9 sws: Added writedelay HTTP server command
This delays between write operations, hopefully making it easier
to spot problems where libcurl doesn't flush the socket properly
before waiting for the next response.
2010-10-02 00:21:59 +02:00
Dan Fandrich 9e1083488f Renamed test1204 to test1117 to move it into the normal range 2010-09-29 13:02:37 -07:00
Daniel Stenberg 5df13c3173 curl_easy_escape: don't escape "unreserved" characters
According to RFC3986 section 2.3 the letters -, ., _ and ~ should not be
percent-encoded.

Reported by: Miguel Diaz
Bug: http://curl.haxx.se/mail/lib-2010-09/0227.html
2010-09-28 23:49:32 +02:00
Dan Fandrich e329586489 Added test case 1204 to test HTTP range failure
This is an attempt to reproduce bug #3076808
2010-09-27 16:44:12 -07:00
Daniel Stenberg 4d58f97f60 parsedate: allow time specified without seconds
The date format in RFC822 allows that the seconds part of HH:MM:SS is
left out, but this function didn't allow it. This change also includes a
modified test case that makes sure that this now works.

Reported by: Matt Ford
Bug: http://curl.haxx.se/bug/view.cgi?id=3076529
2010-09-27 16:54:02 +02:00
Dan Fandrich 8e2f16e66f Link curl and the test apps with -lrt explicitly when necessary
When curl calls a function from that library then it needs to
explicitly link to the library instead of piggybacking on
libcurl's own dependency.  Without this, GNU ld with the
--no-add-needed flag fails when linking (which Fedora now does
by default).

Reported by: Quanah Gibson-Mount
Bug: http://curl.haxx.se/mail/lib-2010-09/0085.html
2010-09-11 17:08:23 -07:00
Tor Arntsen c3c4626fab test565: Don't hardcode IP:PORT
Use %HOSTIP:%HTTPPORT instead of 127.0.0.1:8990 so that
verification works if the baseport change option is used
when executing runtests.pl.
2010-09-09 12:42:28 +02:00
Dan Fandrich 55c266de6d Added proxy keyword to allow skipping test in proxyless configs 2010-08-30 15:07:21 -07:00
Dan Fandrich ae467115bb Tweaked some test data files
Fixed some issues that caused xmllint failures, added features
and keywords, fixed some quotes and removed some <strip> sections
that unnecessarily limited test checking.
2010-08-25 16:43:26 -07:00
Daniel Stenberg a049528e94 runtests: fix uninitialized variable warning 2010-08-25 15:10:40 +02:00
Daniel Stenberg 2fbbddbe85 gopher tests: revert parts of gopher in the pingpong server
Introduced in the initial gopher commits, there was added logic to do
GOPHER test serving in the pingpong server but as it resembles HTTP much
more than FTP or SMTP, the gopher testing has been moved over to instead
use the sws (HTTP) server. This change simply removes unused code.
2010-08-25 14:22:43 +02:00
Daniel Stenberg ecb3fe63d7 gopher tests: use sws and adjusted to more standard style 2010-08-25 14:21:25 +02:00
Daniel Stenberg 6ed72fd7fa sws: added basic gopher support 2010-08-25 14:21:25 +02:00
Daniel Stenberg 53151db167 gopher: fix test case line endings
Patches over email very easily lose CRLF line endings in files otherwise
LF-only so I had to put them back where needed.
2010-08-25 14:21:25 +02:00
Cameron Kaiser 67d1616018 Gopher using Curl_write; test suite (4 tests) 2010-08-25 14:21:25 +02:00
Daniel Stenberg 6b6a3bcb61 http: handle trailer headers in all chunked responses
HTTP allows that a server sends trailing headers after all the chunks
have been sent WITHOUT signalling their presence in the first response
headers. The "Trailer:" header is only a SHOULD there and as we need to
handle the situation even without that header I made libcurl ignore
Trailer: completely.

Test case 1116 was added to verify this and to make sure we handle more
than one trailer header properly.

Reported by: Patrick McManus
Bug: http://curl.haxx.se/bug/view.cgi?id=3052450
2010-08-25 13:42:14 +02:00
Dan Fandrich 77ba147e76 Fixed a NULL pointer dereference in form posting
It was introduced in commit eeb2cb05 along with the -F type=
change. Also fixed a typo in the name of the magic filename=
parameter. Tweaked tests 39 and 173 to better test this path.
2010-08-24 16:45:31 -07:00
Daniel Stenberg eeb2cb05a1 cmdline: make -F type= accept ;charset=
The -F option allows some custom parameters within the given string, and
those strings are separated with semicolons. You can for example specify
"name=daniel;type=text/plain" to set content-type for the
field. However, the use of semicolons like that made it not work fine if
you specified one within the content-type, like for:
"name=daniel;type=text/plain;charset=UTF-8"
... as the second one would be seen as a separator and "charset" is no
parameter curl knows anything about so it was just silently discarded.

The new logic now checks if the semicolon and following keyword looks
like a parameter it knows about and if it isn't it is assumed to be
meant to be used within the content-type string itself.

I modified test case 186 to verify that this works as intended.

Reported by: Larry Stone
Bug: http://curl.haxx.se/bug/view.cgi?id=3048988
2010-08-21 00:21:24 +02:00
Guenter Knauf f37affab8c Trial to fix win32 autobuilds.
It seems that its time to look at some better ideas for the win32
non-configure builds; probably a prebuild target which copies
config-win32.h to curl_config.h and appends also then feature
defines like USE_ARES.
2010-08-20 02:33:29 +02:00
Dan Fandrich ebbe694e78 Removed a C99ism & made an array const 2010-08-18 22:16:46 -07:00
Julien Chaffraix 70baf46d8d test: added test 579 to verify progress callback for chunked post
The 66 bytes checked are those 38 bytes with the chunked encoding
headers added: 8+8+10+35+5 = 66

The three-letter words become 8 bytes on the wire because they are sent
like: "3\r\none\r\n"

... and there's the trailing 5 bytes write after the four lines since
the final chunk is sent (which is "0\r\n\r\n").
2010-08-19 00:27:04 +02:00
Julien Chaffraix 6b490ed33c progress: callback for POSTs less than MAX_INITIAL_POST_SIZE
Add a call to Curl_pgrsSetUploadSize in this case valided by a test
case.

Reported by: Никита Дорохин.
Bug: http://curl.haxx.se/mail/lib-2010-04/0173.html
2010-08-16 22:56:43 +02:00
Dan Fandrich 4d703ee100 Make the LD_PRELOAD path absolute in the tests that use it
In some situations, libtool will change directories and perform
a link step before executing the libtest test app. Since
LD_PRELOAD is in effect for this entire process, the path to the
binary must be absolute so it will be valid no matter in which
directory the app is running.
2010-08-16 13:36:51 -07:00
Dan Fandrich 9f4a174698 Clear stdout and stderr files on each test run
This allows a test to be run several times in the same test
session even when the -k option is given.
2010-08-16 12:09:18 -07:00
Dan Fandrich 72da720b4a Reset environment variables before starting servers
Otherwise, variables from tests could affect the servers
themselves.
2010-08-13 22:14:26 -07:00
Daniel Stenberg a43201e578 runtests: clear old setenv remainders before test
Due to the layout of the singletest function there are situations where
it returns before it clears the environment variables that were
especially set for the single specific test case. That could lead to
subsequent tests getting executed with environment variables sticking
around from a previous test which could lead to badness.

This change makes sure to clear all custom variables that may be laying
around from a previous round, before running a test case.

Reported by: Kamil Dudka
Bug: http://curl.haxx.se/mail/lib-2010-08/0141.html
2010-08-11 23:12:39 +02:00
Daniel Stenberg 37201e3c36 callbacks: acknowledge progress callback error returns
When the progress callback is called during the TCP connection, an error
return would accidentally not abort the operation as intended but would
instead be counted as a failure to connect to that particular IP and
libcurl would just continue to try the next. I made singleipconnect()
and trynextip() return CURLcode properly.

Added bonus: it corrected the error code for bad --interface usages,
like tested in test 1084 and test 1085.

Reported by: Adam Light
Bug: http://curl.haxx.se/mail/lib-2010-08/0105.html
2010-08-10 23:16:08 +02:00
Guenter Knauf ff26895b5c Added msys Perl since git for Win32 comes with own Perl which identifies as msys. 2010-08-10 07:10:57 +02:00
Guenter Knauf 7115245f88 Make testcurl.pl Watcom-aware. 2010-08-10 04:09:35 +02:00
Daniel Stenberg dc2157a087 parse_remote_port: fix ;type= URL suffix over HTTP proxy
Test 563 is enabled now and verifies that the combo FTP type=A URL,
CURLOPT_PORT set and proxy work fine. As a bonus I managed to remove the
somewhat odd FTP check in parse_remote_port() and instead converted it
to a better and more generic 'slash_removed' struct field. Checking the
->protocol field isn't right since when an FTP:// URL is sent over a
HTTP proxy, the protocol is HTTP but the URL was handled by the FTP code
and thus slash_removed is set TRUE for this case.
2010-08-10 00:56:45 +02:00
Yang Tse b24e872502 build: don't build libhostname unless shared libcurl is built 2010-08-09 09:33:53 +02:00
Yang Tse 50a1d5ee1c build: libhostname and chkhostname linkage adjustments followup 2010-08-09 05:45:11 +02:00
Yang Tse c49e9683b8 build: libhostname linkage adjustments followup 2010-08-08 02:59:55 +02:00