Steve Holme [Sun, 17 Nov 2013 09:45:08 +0000 (09:45 +0000)]
smtp: Changed the default command to HELP when no options are specified
Otherwise a NOOP operation would be performed which a) only returns a
single line response and not a multiline response where -I needs to be
used, and b) provides an inconsistent user experience compared to that
of the POP3 and IMAP protocols.
Steve Holme [Sat, 16 Nov 2013 22:56:11 +0000 (22:56 +0000)]
connect: Close open but unconnected socket in singleipconnect()
singleipconnect() could return the file descriptor of an open socket
even though the function returned a CURLE_COULDNT_CONNECT error code
from commit ed1662c374361a and 02fbc26d59c591.
This could cause tests 19, 704 and 1233 to fail on FreeBSD, AIX and
Solaris.
Steve Holme [Sat, 16 Nov 2013 20:33:08 +0000 (20:33 +0000)]
test926: Corrected unknown user reply from commit 0d735c29f92748
The error code should not be sent as data as it isn't passed onto the
client as body data, so cannot be compared in the test suite against
expected data.
Steve Holme [Fri, 15 Nov 2013 21:15:38 +0000 (21:15 +0000)]
DOCS: Updated curl_easy_setopt.3 following recent SMTP changes
* Added information about the verify and expand commands to
CURLOPT_MAIL_RCPT.
* Reworked CURLOPT_CUSTOMREQUEST section, adding information about IMAP
and SMTP custom commands.
Steve Holme [Fri, 15 Nov 2013 20:35:43 +0000 (20:35 +0000)]
lib1507.c: Added missing set of CURLOPT_UPLOAD option
Although this option should have already been set, the SMTP module can
now download information from and send instructional commands to, an
SMTP server, requiring the option to be set in order to perform a mail
transfer.
Steve Holme [Fri, 15 Nov 2013 12:50:37 +0000 (12:50 +0000)]
smtp: Fixed handling of multiline server greeting responses
Incorrectly processed multiline server greeting responses as "wanted"
continue responses in smtp_endofresp(), from commit f16c0de4e9bbe3,
which in turn broke the SMTP server detection in the test suite,
because the EHLO command would not be sent.
Steve Holme [Fri, 15 Nov 2013 10:54:47 +0000 (10:54 +0000)]
smtp: Fixed processing of more than one response when sent in same packet
Added a loop to smtp_statemach_act() in which Curl_pp_readresp() is
called until the cache is drained. Without this multiple responses
received in a single packet could result in a hang or delay.
Steve Holme [Fri, 15 Nov 2013 10:46:29 +0000 (10:46 +0000)]
smtp: Moved EHLO response handling to smtp_state_ehlo_resp()
Similar to the processing of untagged CAPABILITY responses in IMAP moved
the processing of multiline EHLO responses to smtp_state_ehlo_resp() and
introduced an internal response code of one to differentiate a multiline
continuation from the end of command. This also allows for the separate
processing of multiline responses from commands such as VRFY and EXPN.
Björn Stenberg [Tue, 12 Nov 2013 20:09:03 +0000 (21:09 +0100)]
connect: Return the socket descriptor even on fail
singleipconnect() did not return the open socket descriptor on some
errors, thereby sometimes causing a socket leak. This patch ensures
the socket is always returned.
Daniel Stenberg [Thu, 14 Nov 2013 02:58:25 +0000 (18:58 -0800)]
configure: Fix test with -Werror=implicit-function-declaration
The ipv6 auto-detect test in configure returns a false negative when
CFLAGS contains -Werror=implicit-function-declaration. (I have been
using this flag to detect code issues that would result in SEGVs on
x86_64-cygwin.)
Nick Zitzmann [Wed, 13 Nov 2013 02:26:20 +0000 (20:26 -0600)]
darwinssl: check for SSLSetSessionOption() presence when toggling BEAST
Even though this is only a formality (since not many people build on
Mavericks while targeting Leopard), since we still support Leopard
at the earliest, we might as well be pedantic.
Nick Zitzmann [Wed, 13 Nov 2013 02:18:04 +0000 (20:18 -0600)]
darwinssl: PKCS#12 import feature now requires Lion or later
It turns out that some of the constants necessary to make this feature
work are missing from Snow Leopard's Security framework even though
they are defined in the headers.
Steve Holme [Tue, 12 Nov 2013 19:01:04 +0000 (19:01 +0000)]
curl_easy_setopt: Added the ability to set the login options separately
Rather than set the authentication options as part of the login details
specified in the URL, or via the older CURLOPT_USERPWD option, added a
new libcurl option to allow the login options to be set separately.
Björn Stenberg [Mon, 11 Nov 2013 22:43:48 +0000 (23:43 +0100)]
multi: Set read socket when returning READSOCK(0)
This patch fixes and issue introduced in commit 7d7df831981fee, if the
tunnel state was TUNNEL_CONNECT, waitconnect_getsock() would return a
bitmask indicating a readable socket but never stored the socket in the
return array.
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.