As the IMAP regex could fail and $1 would not contain the command id
updated the unrecognised command response to be more generic and
realistic (like those used in the command handlers).
Additionally updated the POP3, SMTP and FTP responses.
Our own printf() replacement clearly can't properly handle %.*s with a
string that isn't zero terminated. Instead of fixing the printf code or
even figuring out what the proper posix behavior is, I reverted this
piece of the code back to the previous version where it does malloc +
memcpy instead.
Regression added in e839446c2a5, released in curl 7.32.0.
Reported-by: Felix Yan
Bug: http://curl.haxx.se/bug/view.cgi?id=1295
Björn Stenberg [Tue, 29 Oct 2013 10:51:25 +0000 (11:51 +0100)]
connect: Add connection delay to Happy Eyeballs.
This patch adds a 200ms delay between the first and second address
family socket connection attempts.
It also iterates over IP addresses in the order returned by the
system, meaning most dual-stack systems will try IPv6 first.
Additionally, it refactors the connect code, removing most code that
handled synchronous connects. Since all sockets are now non-blocking,
the logic can be made simpler.
Steve Holme [Sun, 3 Nov 2013 11:27:12 +0000 (11:27 +0000)]
connect: Fixed "Whut?" no server connection failures
Introduced in commit 7d7df831981fee curl would loop displaying "Whut?"
if it was trying to connect to an address and port that didn't have
anything listening on it.
Steve Holme [Sat, 2 Nov 2013 11:18:39 +0000 (11:18 +0000)]
http: Added proxy tunnel authentication message header value extraction
...following recent changes to Curl_base64_decode() rather than trying
to parse a header line for the authentication mechanisms which is CRLF
terminated and inline zero terminate it.
Steve Holme [Wed, 30 Oct 2013 21:33:28 +0000 (21:33 +0000)]
http: Added authentication message header value extraction
...following recent changes to Curl_base64_decode() rather than trying
to parse a header line for the authentication mechanisms which is CRLF
terminated and inline zero terminate it.
Steve Holme [Wed, 30 Oct 2013 07:31:22 +0000 (07:31 +0000)]
base64: Added basic validation to base64 input string when decoding
A base64 string should be a multiple of 4 characters in length, not
contain any more than 2 padding characters and only contain padding
characters at the end of string. For example: Y3VybA==
Strings such as the following are considered invalid:
Y= - Invalid length
Y== - Invalid length
Y=== - More than two padding characters
Y=x= - Padding character contained within string
Gisle Vanem [Thu, 24 Oct 2013 13:21:16 +0000 (15:21 +0200)]
docs/examples/httpput.c: fix build for MSVC
"Dan Fandrich" <dan@coneharvesters.com> wrote:
>> But I'm not sure <unistd.h> is needed at all.
>
> It's needed for close(2). But the only reason that's needed is because fstat
> is used instead of stat(2); if you fix that, then you could remove that
> include altogether.
Okay. I've tested the following with MSVC and MingW. htttput.c now
simply uses stat():
Björn Stenberg [Sat, 26 Oct 2013 12:17:33 +0000 (14:17 +0200)]
Add "Happy Eyeballs" for IPv4/IPv6.
This patch invokes two socket connect()s nearly simultaneously, and
the socket that is first connected "wins" and is subsequently used for
the connection. The other is terminated.
There is a very slight IPv4 preference, in that if both sockets connect
simultaneously IPv4 is checked first and thus will win.
Steve Holme [Sun, 27 Oct 2013 09:10:38 +0000 (09:10 +0000)]
email: Added initial support for cancelling authentication
Should a client application fail to decode an authentication message
received from a server, or not support any of the parameters given by
the server in the message, then the authentication phrase should be
cancelled gracefully by the client rather than simply terminating the
connection.
The authentication phrase should be cancelled by simply sending a '*'
to the server, in response to erroneous data being received, as per
RFC-3501, RFC-4954 and RFC-5034.
This patch adds the necessary state machine constants and appropriate
response handlers in order to add this functionality for the CRAM-MD5,
DIGEST-MD5 and NTLM authentication mechanisms.
Daniel Stenberg [Sat, 26 Oct 2013 18:19:27 +0000 (20:19 +0200)]
FTP: make the data connection work when going through proxy
This is a regression since the switch to always-multi internally c43127414d89c.
Test 1316 was modified since we now clearly call the Curl_client_write()
function when doing the LIST transfer part and then the
handler->protocol says FTP and ftpc.transfertype is 'A' which implies
text converting even though that the response is initially a HTTP
CONNECT response in this case.
Steve Holme [Sat, 26 Oct 2013 10:09:31 +0000 (11:09 +0100)]
smtp: Fixed response code parsing for bad AUTH continuation responses
This workaround had been previously been implemented for IMAP and POP3
but not SMTP. Some of the recent test case additions implemented this
behaviour to emulate a bad server and the SMTP code didn't cope with it.
Steve Holme [Fri, 25 Oct 2013 23:24:45 +0000 (00:24 +0100)]
test907: Corrected DIGEST-MD5 response given in commit 820ed48a0088cd
As the URI, which is contained within the DIGEST-MD5 response, is
constructed from the service and realm, the encoded message differs
from that generated under POP3.
Patrick Monnerat [Fri, 25 Oct 2013 16:37:37 +0000 (18:37 +0200)]
OS400: sync RPG wrapper, zlib support, fix header file names, ...
IFS compilation support, SSL GSKit backend by default, TLSv1.[12] support in
GSKit for OS400 >= V7R1, no more tabs in make scripts.
Rémy Léone [Thu, 17 Oct 2013 13:10:18 +0000 (15:10 +0200)]
Adding a .travis.yml file to use the travis-ci.org
From wikipedia:
Travis CI is a hosted, distributed continuous integration service used
to build and test projects hosted at GitHub.
Travis CI is configured by adding a file named .travis.yml, which is a
YAML format text file, to the root directory of the GitHub repository.
Travis CI automatically detects when a commit has been made and pushed
to a GitHub repository that is using Travis CI, and each time this
happens, it will try to build the project and run tests. This includes
commits to all branches, not just to the master branch. When that
process has completed, it will notify a developer in the way it has been
configured to do so — for example, by sending an email containing the
test results (showing success or failure), or by posting a message on an
IRC channel. It can be configured to run the tests on a range of
different machines, with different software installed (such as older
versions of a programming language, to test for compatibility).
Kamil Dudka [Mon, 21 Oct 2013 16:47:54 +0000 (18:47 +0200)]
ssh: initialize per-handle data in ssh_connect()
... if not already initialized. This fixes a regression introduced by
commit 4ad8e142da463ab208d5b5565e53291c8e5ef038, which caused test619
to intermittently fail on certain machines (namely Fedora build hosts).