Steve Holme [Sat, 9 Mar 2013 11:55:48 +0000 (11:55 +0000)]
email: Simplified the logout / quit functions
Moved the blocking state machine to the disconnect functions so that the
logout / quit functions are only responsible for sending the actual
command needed to logout or quit.
Steve Holme [Fri, 8 Mar 2013 21:18:36 +0000 (21:18 +0000)]
imap: Fixed handling of untagged responses for the STORE custom command
Added an exception, for the STORE command, to the untagged response
processor in imap_endofresp() as servers will back respones containing
the FETCH keyword instead.
Yang Tse [Fri, 8 Mar 2013 17:43:03 +0000 (18:43 +0100)]
curlbuild.h.dist: enhance non-configure GCC ABI detection logic
GCC specific adjustments:
- check __ILP32__ before 32 and 64bit processor architectures in
order to detect ILP32 programming model on 64 bit processors
which, of course, also support LP64 programming model, when using
gcc 4.7 or newer.
- keep 32bit processor architecture checks in order to support gcc
versions older than 4.7 which don't define __ILP32__
- check __LP64__ for gcc 3.3 and newer, while keeping 64bit processor
architecture checks for older versions which don't define __LP64__
Jiri Hruska [Tue, 5 Mar 2013 17:03:48 +0000 (18:03 +0100)]
imap: Updated ftpserver.pl to be more compliant, added new commands
Enriched IMAP capabilities of ftpserver.pl in order to be able to
add tests for the new IMAP features.
* Added support for APPEND - Saves uploaded data to log/upload.$testno
* Added support for LIST - Returns the contents of <reply/> section in
the current test, like e.g FETCH.
* Added support for STORE - Returns hardcoded updated flags
* Changed handling of SELECT - Returns much more information in the
usual set of untagged responses; uses hardcoded data from an example
in the IMAP RFC
* Changed handling of FETCH - Fixed response format
Steve Holme [Wed, 6 Mar 2013 19:33:49 +0000 (19:33 +0000)]
imap: Added check for empty UID in FETCH command
As the UID has to be specified by the user for the FETCH command to work
correctly, added a check to imap_fetch(), although strictly speaking it
is protected by the call from imap_perform().
The option needs to be set on the SSL socket. Setting it on the model
takes no effect. Note that the non-blocking mode is still not enabled
for the handshake because the code is not yet ready for that.
Steve Holme [Tue, 5 Mar 2013 19:45:51 +0000 (19:45 +0000)]
curl_setup.h: Added S_IRDIR() macro for compilers that don't support it
Commit 26eaa8383001 introduces the use of S_ISDIR() yet some compilers,
such as MSVC don't support it, so we must define a substitute using
file flags and mask.
Daniel Stenberg [Mon, 4 Mar 2013 14:20:22 +0000 (15:20 +0100)]
AddFormData: prevent only directories from being posted
Commit f4cc54cb4746ae5a6d (shipped as part of the 7.29.0 release) was a
bug fix that introduced a regression in that while trying to avoid
allowing directory names, it also forbade "special" files like character
devices and more. like "/dev/null" as was used by Oliver who reported
this regression.
Reported by: Oliver Gondža
Bug: http://curl.haxx.se/mail/archive-2013-02/0040.html
Nick Zitzmann [Mon, 4 Mar 2013 05:11:10 +0000 (22:11 -0700)]
darwinssl: fix infinite loop if server disconnected abruptly
If the server hung up the connection without sending a closure alert,
then we'd keep probing the socket for data even though it's dead. Now
we're ready for this situation.
Bug: http://curl.haxx.se/mail/lib-2013-03/0014.html
Reported by: Aki Koskinen
Steve Holme [Sun, 3 Mar 2013 13:48:22 +0000 (13:48 +0000)]
smtp: Updated the coding style for state changes after a send operation
Some state changes would be performed after a failure test that
performed a hard return, whilst others would be performed within a test
for success. Updated the code, for consistency, so all instances are
performed within a success test.
Steve Holme [Sun, 3 Mar 2013 13:36:12 +0000 (13:36 +0000)]
pop3: Updated the coding style for state changes after a send operation
Some state changes would be performed after a failure test that
performed a hard return, whilst others would be performed within a test
for success. Updated the code, for consistency, so all instances are
performed within a success test.
Jiri Hruska [Sun, 3 Mar 2013 10:09:44 +0000 (11:09 +0100)]
imap: Added custom request perform and response handler functions
Added imap_custom(), which initiates the custom command processing,
and an associated response handler imap_state_custom_resp(), which
handles any responses by sending them to the client as body data.
All untagged responses with the same name as the first word of the
custom request string are accepted, with the exception of SELECT and
EXAMINE which have responses that cannot be easily identified. An
extra check has been provided for them so that any untagged responses
are accepted for them.
Jiri Hruska [Sun, 3 Mar 2013 09:49:37 +0000 (10:49 +0100)]
imap: Added custom request parsing
Added imap_parse_custom_request() for parsing the CURLOPT_CUSTOMREQUEST
parameter which URL decodes the value and separates the request from
any parameters - This makes it easier to filter untagged responses
by the request command.
Steve Holme [Sat, 2 Mar 2013 20:35:03 +0000 (20:35 +0000)]
imap: Changed successful response logic in imap_state_append_resp()
For consistency changed the logic of the imap_state_append_resp()
function to test for an unsucessful continuation response rather than a
succesful one.
Jiri Hruska [Fri, 1 Mar 2013 19:34:51 +0000 (20:34 +0100)]
imap: Implemented APPEND final processing
The APPEND operation needs to be performed in several steps:
1) We send "<tag> APPEND <mailbox> <flags> {<size>}\r\n"
2) Server responds with continuation respose "+ ...\r\n"
3) We start the transfer and send <size> bytes of data
4) Only now we end the request command line by sending "\r\n"
5) Server responds with "<tag> OK ...\r\n"
This commit performs steps 4 and 5, in the DONE phase, as more
processing is required after the transfer.
Steve Holme [Thu, 28 Feb 2013 22:46:22 +0000 (22:46 +0000)]
imap: Updated the coding style for state changes after a send operation
Some state changes would be performed after a failure test that
performed a hard return, whilst others would be performed within a test
for success. Updated the code, for consistency, so all instances are
performed within a success test.
Jiri Hruska [Thu, 28 Feb 2013 18:42:42 +0000 (19:42 +0100)]
imap: Added processing of the final FETCH responses
Not processing the final FETCH responses was not optimal, not only
because the response code would be ignored but it would also leave data
unread on the socket which would prohibit connection reuse.
Jiri Hruska [Thu, 28 Feb 2013 18:16:33 +0000 (19:16 +0100)]
imap: Introduced FETCH_FINAL state for processing final fetch responses
A typical FETCH response can be broken down into four parts:
1) "* <uid> FETCH (<what> {<size>}\r\n", using continuation syntax
2) <size> bytes of the actual message
3) ")\r\n", finishing the untagged response
4) "<tag> OK ...", finishing the command
Part 1 is read in imap_fetch_resp(), part 2 is consumed in the PERFORM
phase by the transfer subsystem, parts 3 and 4 are currently ignored.
Jiri Hruska [Wed, 27 Feb 2013 18:49:00 +0000 (19:49 +0100)]
imap: Added processing of more than one response when sent in same packet
Added a loop to imap_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.