Daniel Stenberg [Mon, 10 Jan 2011 23:14:36 +0000 (00:14 +0100)]
connect: use UDP correctly
The idea that the protocol and socktype is part of name resolving in the
libc functions is nuts. We keep the name resolver functions assume
TCP/STREAM and we make sure that when we want to connect to a UDP
service we use the correct UDP/DGRAM set instead. This bug was because
the ->protocol field was not always set correctly.
This bug was only affecting ipv6-disabled non-cares non-threaded builds.
Dan Fandrich [Thu, 6 Jan 2011 07:53:24 +0000 (23:53 -0800)]
Made unit_setup() return an error code to abort the test early
This makes it possible to skip the call to unit_stop() in such
cases. Also use Curl_safefree() in unit test 1302 so it will
pass the memory torture test.
Brad King [Wed, 5 Jan 2011 16:32:41 +0000 (17:32 +0100)]
CMake: Use upstream CheckTypeSize module
The CheckTypeSize module that comes with CMake 2.6.2 and above does
everything we need and also supports cross-compiling. Avoid duplicating
an older version of it here. This also fixes a cross-compiling error
because the old line
include ("${CMAKE_MODULE_PATH}/CheckTypeSize.cmake")
failed because CMAKE_MODULE_PATH is a search path and not a directory.
Daniel Stenberg [Mon, 3 Jan 2011 22:47:34 +0000 (23:47 +0100)]
curlcheck.h: add fail_if() fix code
The UNITTEST_START and UNITTEST_STOP defines needed to do a new brace
level so that test cases can declare variables fine and still remain
fine C89 code.
Daniel Stenberg [Mon, 3 Jan 2011 21:42:46 +0000 (22:42 +0100)]
unittests: a dedicated feature in tests
The test runner script now knows if unittests can run and the unit test
setup file says it is one. I also made runtests.pl deal with no
<command> tag set, so that the description file can get even simpler.
Daniel Stenberg [Mon, 3 Jan 2011 21:16:16 +0000 (22:16 +0100)]
unittesting: build a separate static lib
When configure --enable-debug has been used, all files in lib/ are now
built twice and a separate static library crafted for unit-testing will
be linked. The unit tests in the tests/unit subdir will use that
library.
Daniel Stenberg [Sun, 2 Jan 2011 22:41:49 +0000 (23:41 +0100)]
Curl_nss_connect: avoid PATH_MAX
Since some systems don't have PATH_MAX and it isn't that clever to
assume a fixed maximum path length, the code now allocates buffer space
instead of using stack.
Reported by: Samuel Thibault
Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608521
Daniel Stenberg [Sat, 1 Jan 2011 14:35:53 +0000 (15:35 +0100)]
SFTP: make pwd output result to header callback
Sending "pwd" as a QUOTE command only sent the reply to the
DEBUGFUNCTION. Now it also sends an FTP-like header to the header
callback to allow similar operations as with FTP, and apps can re-use
the same parser.
Daniel Stenberg [Mon, 27 Dec 2010 08:55:13 +0000 (09:55 +0100)]
c-ares: fix cancelled resolves
When built IPv6-enabled, we could do Curl_done() with one of the two
resolves having returned already, so when ares_cancel() is called the
resolve callback ends up doing funny things (sometimes resulting in a
segfault) since it would try to actually store the previous resolve even
though we're shutting down the resolve.
This bug was introduced in commit 8ab137b2bc9630ce so it hasn't been
included in any public release.
Bug: http://curl.haxx.se/bug/view.cgi?id=3145445
Reported by: Pedro Larroy
Daniel Stenberg [Thu, 23 Dec 2010 21:52:32 +0000 (22:52 +0100)]
cookies: tricked dotcounter fixed
Providing multiple dots in a series in the domain field (domain=..com) could
trick the cookie engine to wrongly accept the cookie believing it to be
fine. Since the tailmatching would then match all .com sites, the cookie would
then be sent to all of them.
The code now requires at least one letter between each dot for them to be
counted. Edited test case 61 to verify this.
Daniel Stenberg [Thu, 23 Dec 2010 21:19:25 +0000 (22:19 +0100)]
multi: connect fail => use next IP address
When using the multi interface and connecting to a host name that
resolves to multiple IP addresses, there was no logic that made it
continue to the next IP if connecting to the first address times
out. This is now corrected.
Daniel Stenberg [Wed, 22 Dec 2010 14:29:21 +0000 (15:29 +0100)]
multi: inhibit some verbose outputs
The info about pipe status and expire cleared are clearly debug-related
and not anything mere mortals will or should care about so they are now
ifdef'ed DEBUGBUILD
Daniel Stenberg [Wed, 22 Dec 2010 13:53:13 +0000 (14:53 +0100)]
SMTP tests: updated MAIL FROM use
They were all wrong previously since none used the <brackets> they
should for MAIL FROM. Now libcurl adds them itself if the app doesn't so
they end up wrong less easy.
Brad Hards [Wed, 22 Dec 2010 13:41:53 +0000 (14:41 +0100)]
SMTP: add brackets for MAIL FROM
Similar to what is done already for RCPT TO, the code now checks for and
adds angle brackets (<>) around the email address that is provided for
CURLOPT_MAIL_RCPT unless the app has done so itself.
Daniel Stenberg [Sat, 18 Dec 2010 23:15:12 +0000 (00:15 +0100)]
ftp_parselist: fix compiler warning
Doing curlx_strtoofft() on the size just to figure out the end of it
causes a compiler warning since the result wasn't used, but is also a
bit of a waste.
Pasha Kuznetsov [Sat, 18 Dec 2010 21:35:37 +0000 (22:35 +0100)]
Curl_do: avoid using stale conn pointer
Since the original `conn' pointer was used after the `connectdata' it
points to has been closed/cleaned up by Curl_reconnect_request it caused
a crash. We must make sure to use the newly created connection instead!
Tommie Gannert [Sat, 18 Dec 2010 21:31:39 +0000 (22:31 +0100)]
ares: ask for both IPv4 and IPv6 addresses
Make the c-ares resolver code ask for both IPv4 and IPv6 addresses when
IPv6 is enabled.
This is a workaround for the missing ares_getaddrinfo() and is a lot
easier to implement.
Note that as long as c-ares returns IPv4 addresses when IPv6 addresses
were requested but missing, this will cause a host's IPv4 addresses to
occur twice in the DNS cache.
Daniel Stenberg [Wed, 15 Dec 2010 10:11:20 +0000 (11:11 +0100)]
axtls_connect: allow connect without peer verification
The SSL_SERVER_VERIFY_LATER bit in the ssl_ctx_new() call allows the
code to verify the peer certificate explicitly after the handshake and
then the "data->set.ssl.verifypeer" option works.
Daniel Stenberg [Fri, 10 Dec 2010 23:53:37 +0000 (00:53 +0100)]
urldate: undef hideous memory defines
The public axTLS header (at least as of 1.2.7) redefines the memory
functions. We #undef those again immediately after the public header to
limit the damage. This should be fixed in axTLS.
Eric Hu [Tue, 7 Dec 2010 00:18:35 +0000 (16:18 -0800)]
Initial axTLS integration. Connections can be made and some tests pass.
Failed HTTPS tests: 301, 306, 311, 312, 313, 560
311, 312 need more detailed error reporting from axTLS.
313 relates to CRL, which hasn't been implemented yet.
Eric Hu [Fri, 3 Dec 2010 18:23:45 +0000 (10:23 -0800)]
Preparing for axTLS. Actual SSL API functions are only stubbed.
Added axTLS to autotool files and glue code to misc other files.
axtls.h maps SSL API functions, but may change.
axtls.c is just a stub file and will definitely change.