platform/upstream/curl.git
11 years agobuild_vms.com: VMS build fixes
Tom Grace [Wed, 13 Mar 2013 03:58:51 +0000 (04:58 +0100)]
build_vms.com: VMS build fixes

Added missing slash in cc_full_list.
Removed unwanted extra quotes inside symbol tool_main
for non-VAX architectures that triggered link failure.
Replaced curl_sys_inc with sys_inc.

11 years agotool_main.c: fix VMS global variable storage-class specifier
Tom Grace [Wed, 13 Mar 2013 02:13:52 +0000 (03:13 +0100)]
tool_main.c: fix VMS global variable storage-class specifier

An extern submits a psect and a global reference to the linker to point
to it. Using "extern int vms_show = 0" also creates a globaldef.

The use of the extern by itself does declare a psect but does not declare
a globalsymbol. It does declare a globalref. But the linker needs one and
only one globaldef or there is an error.

11 years agoOS400: synchronize RPG binding
Patrick Monnerat [Tue, 12 Mar 2013 14:37:34 +0000 (15:37 +0100)]
OS400: synchronize RPG binding

11 years agopop3: Fixed continuous wait when using --ftp-list
Steve Holme [Tue, 12 Mar 2013 13:09:03 +0000 (13:09 +0000)]
pop3: Fixed continuous wait when using --ftp-list

Don't initiate a transfer when using --ftp-list.

11 years agocurl_global_init: accept the CURL_GLOBAL_ACK_EINTR flag
Zdenek Pavlas [Mon, 11 Mar 2013 13:57:07 +0000 (14:57 +0100)]
curl_global_init: accept the CURL_GLOBAL_ACK_EINTR flag

The flag can be used in pycurl-based applications where using the multi
interface would not be acceptable because of the performance lost caused
by implementing the select() loop in python.

Bug: http://curl.haxx.se/bug/view.cgi?id=1168
Downstream Bug: https://bugzilla.redhat.com/919127

11 years agoeasy: do not ignore poll() failures other than EINTR
Kamil Dudka [Mon, 11 Mar 2013 15:57:25 +0000 (16:57 +0100)]
easy: do not ignore poll() failures other than EINTR

11 years agocurl.h: stricter CURL_EXTERN linkage decorations logic
Yang Tse [Mon, 11 Mar 2013 23:24:37 +0000 (00:24 +0100)]
curl.h: stricter CURL_EXTERN linkage decorations logic

No API change involved.

Info: http://curl.haxx.se/mail/lib-2013-02/0234.html

11 years agoTHANKS: Latin-1'ified Jiri's name
Daniel Stenberg [Mon, 11 Mar 2013 18:40:02 +0000 (19:40 +0100)]
THANKS: Latin-1'ified Jiri's name

11 years agotest806: Added CRLF to reply data to be compliant with RFC-822
Steve Holme [Mon, 11 Mar 2013 13:06:55 +0000 (13:06 +0000)]
test806: Added CRLF to reply data to be compliant with RFC-822

11 years agotest805: added crlf newlines to make data size match
Daniel Stenberg [Mon, 11 Mar 2013 12:26:15 +0000 (13:26 +0100)]
test805: added crlf newlines to make data size match

since mails sent are supposed to have CRLF line endings I added them and
now the data size after (\Seen) matches again properly

11 years agotest: fix newline for the data check of 807
Daniel Stenberg [Mon, 11 Mar 2013 12:23:51 +0000 (13:23 +0100)]
test: fix newline for the data check of 807

11 years agotest801 to test807: fix protocol section line endings
Yang Tse [Mon, 11 Mar 2013 11:48:36 +0000 (12:48 +0100)]
test801 to test807: fix protocol section line endings

11 years agoMakefile.am: Corrected a couple of spurious tab characters
Steve Holme [Sun, 10 Mar 2013 20:27:05 +0000 (20:27 +0000)]
Makefile.am: Corrected a couple of spurious tab characters

Corrected a couple of tab characters between test702 and test703, and
between test900 and test901 which should be spaces.

11 years agoimap: Added test807 for custom request functionality (STORE)
Jiri Hruska [Sun, 10 Mar 2013 20:22:10 +0000 (21:22 +0100)]
imap: Added test807 for custom request functionality (STORE)

11 years agoimap: Added test806 for IMAP (folder) LIST command
Jiri Hruska [Sun, 10 Mar 2013 20:13:59 +0000 (21:13 +0100)]
imap: Added test806 for IMAP (folder) LIST command

11 years agoimap: Added test805 for APPEND functionality
Jiri Hruska [Sun, 10 Mar 2013 20:02:55 +0000 (21:02 +0100)]
imap: Added test805 for APPEND functionality

11 years agoimap: Added test804 for skipping SELECT if in the same mailbox
Jiri Hruska [Sun, 10 Mar 2013 19:52:30 +0000 (20:52 +0100)]
imap: Added test804 for skipping SELECT if in the same mailbox

11 years agoimap: Added test802 and test803 for UIDVALIDITY verification
Jiri Hruska [Sun, 10 Mar 2013 19:40:28 +0000 (20:40 +0100)]
imap: Added test802 and test803 for UIDVALIDITY verification

Added one test for a request with matching UIDVALIDITY and one which is
a mismatched request that will fail.

11 years agoimap: Added test801 for UID and SECTION URL parameters
Jiri Hruska [Sun, 10 Mar 2013 19:37:41 +0000 (20:37 +0100)]
imap: Added test801 for UID and SECTION URL parameters

11 years agoimap-tests: Accept quoted parameters in ftpserver.pl
Jiri Hruska [Sun, 10 Mar 2013 19:29:31 +0000 (20:29 +0100)]
imap-tests: Accept quoted parameters in ftpserver.pl

Any IMAP parameter can come in escaped and in double quotes. Added a
simple function to unquote the command parameters and applied it to
the IMAP command handlers.

11 years agotests: Fix ftpserver.pl indentation
Jiri Hruska [Sun, 10 Mar 2013 19:23:27 +0000 (20:23 +0100)]
tests: Fix ftpserver.pl indentation

The whole of FETCH_imap() had one extra space of indentation, whilst
APPEND_imap() used indentation of 2 instead of 4 in places.

11 years agoMakefile.am: Corrected end of line filler character
Steve Holme [Sun, 10 Mar 2013 19:00:39 +0000 (19:00 +0000)]
Makefile.am: Corrected end of line filler character

The majority of lines, that specify a test file for inclusion, end with
a tab character before the slash whilst some end with a space. Corrected
those that end with a space to end with a tab character as well.

11 years agoemail-tests: Updated the test data that corresponds to the test number
Steve Holme [Sun, 10 Mar 2013 19:55:22 +0000 (19:55 +0000)]
email-tests: Updated the test data that corresponds to the test number

Finished segregating the email protocol tests, into their own protocol
based ranges, in preparation of adding more e-mail related tests to the
test suite.

11 years agoemail-tests: Renamed the IMAP test to be 800
Steve Holme [Sun, 10 Mar 2013 18:50:43 +0000 (18:50 +0000)]
email-tests: Renamed the IMAP test to be 800

Continued segregating the email protocol tests, into their own protocol
based ranges, in preparation of adding more e-mail related tests to the
test suite.

11 years agoemail-tests: Renamed the SMTP tests to be in the range 900-906
Steve Holme [Sun, 10 Mar 2013 18:48:08 +0000 (18:48 +0000)]
email-tests: Renamed the SMTP tests to be in the range 900-906

Continued segregating the email protocol tests, into their own protocol
based ranges, in preparation of adding more e-mail related tests to the
test suite.

11 years agoemail-tests: Renamed the POP3 tests to be in the range 850-857
Steve Holme [Sun, 10 Mar 2013 18:45:24 +0000 (18:45 +0000)]
email-tests: Renamed the POP3 tests to be in the range 850-857

Started segregating the email protocol tests, into their own protocol
based ranges, in preparation of adding more e-mail related tests to the
test suite.

11 years agohiperfifo: updated to use current libevent API
Daniel Stenberg [Sun, 10 Mar 2013 18:44:48 +0000 (19:44 +0100)]
hiperfifo: updated to use current libevent API

Patch by: Myk Taylor

11 years agoimap: Reworked some function descriptions
Steve Holme [Sun, 10 Mar 2013 12:56:45 +0000 (12:56 +0000)]
imap: Reworked some function descriptions

11 years agoimap: Added some missing comments to imap_sendf()
Steve Holme [Sun, 10 Mar 2013 12:47:28 +0000 (12:47 +0000)]
imap: Added some missing comments to imap_sendf()

11 years agoemail: Removed hard returns from init functions
Steve Holme [Sat, 9 Mar 2013 22:25:40 +0000 (22:25 +0000)]
email: Removed hard returns from init functions

11 years agocurl_multi_wait: avoid second loop if nothing to do
Daniel Stenberg [Sat, 9 Mar 2013 21:26:07 +0000 (22:26 +0100)]
curl_multi_wait: avoid second loop if nothing to do

... hopefully this will also make clang-analyzer stop warning on
potentional NULL dereferences (which were false positives anyway).

11 years agomulti_runsingle: avoid NULL dereference
Daniel Stenberg [Sat, 9 Mar 2013 17:05:28 +0000 (18:05 +0100)]
multi_runsingle: avoid NULL dereference

When Curl_do() returns failure, the connection pointer could be NULL so
the code path following needs to that that into account.

Bug: http://curl.haxx.se/mail/lib-2013-03/0062.html
Reported by: Eric Hu

11 years agoimap: Re-factored all perform based functions
Steve Holme [Sat, 9 Mar 2013 18:50:41 +0000 (18:50 +0000)]
imap: Re-factored all perform based functions

Standardised the naming of all perform based functions to be in the form
imap_perform_something().

11 years agoexamples/getinmemory.c: abort the transfer if not enough memory
Cédric Deltheil [Sun, 24 Feb 2013 17:17:30 +0000 (18:17 +0100)]
examples/getinmemory.c: abort the transfer if not enough memory

No more use exit(3) but instead tell libcurl that no byte has been
written to let it return a `CURLE_WRITE_ERROR`. In addition, check
curl easy handle return code.

11 years agoRELEASE-NOTES: synced with ca3c0ed3a9c
Daniel Stenberg [Sat, 9 Mar 2013 15:31:57 +0000 (16:31 +0100)]
RELEASE-NOTES: synced with ca3c0ed3a9c

8 more bugfixes, one change and a bunch of contributors

11 years agoMakefile.am: empty AM_LDFLAGS definition for automake 1.7 compatibility
Yang Tse [Sat, 9 Mar 2013 15:23:04 +0000 (16:23 +0100)]
Makefile.am: empty AM_LDFLAGS definition for automake 1.7 compatibility

11 years agoimap: Added description comments to all perform based functions
Steve Holme [Sat, 9 Mar 2013 14:02:56 +0000 (14:02 +0000)]
imap: Added description comments to all perform based functions

11 years agoimap: Removed the need for separate custom request functions
Steve Holme [Sat, 9 Mar 2013 13:26:59 +0000 (13:26 +0000)]
imap: Removed the need for separate custom request functions

Moved the custom request processing into the LIST command as the logic
is the same.

11 years agoimap: Corrected typo in comment
Steve Holme [Sat, 9 Mar 2013 13:25:15 +0000 (13:25 +0000)]
imap: Corrected typo in comment

11 years agoMakefile.am: empty AM_LDFLAGS definition for automake 1.7 compatibility
Yang Tse [Sat, 9 Mar 2013 12:57:55 +0000 (13:57 +0100)]
Makefile.am: empty AM_LDFLAGS definition for automake 1.7 compatibility

11 years agoimap: Moved imap_logout() to be grouped with the other perform functions
Steve Holme [Sat, 9 Mar 2013 12:12:20 +0000 (12:12 +0000)]
imap: Moved imap_logout() to be grouped with the other perform functions

11 years agoemail: Updated the function descriptions for the logout / quit functions
Steve Holme [Sat, 9 Mar 2013 12:10:01 +0000 (12:10 +0000)]
email: Updated the function descriptions for the logout / quit functions

Updated the function description comments following commit 4838d196fdbf.

11 years agoemail: Simplified the logout / quit functions
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.

Additionally removed the hard return on failure.

11 years agoemail: Tidied up the *_regular_transfer() functions
Steve Holme [Fri, 8 Mar 2013 23:25:04 +0000 (23:25 +0000)]
email: Tidied up the *_regular_transfer() functions

Added comments and simplified convoluted dophase_done comparison.

11 years agoemail: Simplified nesting of if statements in *_doing() functions
Steve Holme [Fri, 8 Mar 2013 23:02:20 +0000 (23:02 +0000)]
email: Simplified nesting of if statements in *_doing() functions

11 years agoRELEASE-NOTES: mention that krb4 is up for consideration
Daniel Stenberg [Fri, 8 Mar 2013 15:34:40 +0000 (16:34 +0100)]
RELEASE-NOTES: mention that krb4 is up for consideration

11 years agoimap: Fixed handling of untagged responses for the STORE custom command
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.

11 years agocurlbuild.h.dist: enhance non-configure GCC ABI detection logic
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__

11 years agocurlbuild.h.dist: fix GCC build on ARM systems without configure script
Yang Tse [Fri, 8 Mar 2013 14:30:44 +0000 (15:30 +0100)]
curlbuild.h.dist: fix GCC build on ARM systems without configure script

Bug: http://curl.haxx.se/bug/view.cgi?id=1205
Reported by: technion

11 years agopolarssl.c: fix header filename typo
Gisle Vanem [Fri, 8 Mar 2013 13:02:01 +0000 (14:02 +0100)]
polarssl.c: fix header filename typo

11 years agoconfigure: use XC_LIBTOOL for portability across libtool versions
Yang Tse [Fri, 8 Mar 2013 12:26:08 +0000 (13:26 +0100)]
configure: use XC_LIBTOOL for portability across libtool versions

11 years agoxc-lt-iface.m4: provide XC_LIBTOOL macro
Yang Tse [Fri, 8 Mar 2013 12:25:07 +0000 (13:25 +0100)]
xc-lt-iface.m4: provide XC_LIBTOOL macro

11 years agoimap: Fixed SELECT not being performed for custom requests
Steve Holme [Thu, 7 Mar 2013 22:56:19 +0000 (22:56 +0000)]
imap: Fixed SELECT not being performed for custom requests

11 years agoemail: Minor code tidy up following recent changes
Steve Holme [Thu, 7 Mar 2013 22:44:10 +0000 (22:44 +0000)]
email: Minor code tidy up following recent changes

Removed unwanted braces and added variable initialisation.

11 years agoDOCS: Corrected the IMAP URL grammar of the UIDVALIDITY parameter
Steve Holme [Thu, 7 Mar 2013 20:53:15 +0000 (20:53 +0000)]
DOCS: Corrected the IMAP URL grammar of the UIDVALIDITY parameter

11 years agoFEATURES: Provided a little clarity in some IMAP features
Steve Holme [Thu, 7 Mar 2013 18:31:48 +0000 (18:31 +0000)]
FEATURES: Provided a little clarity in some IMAP features

11 years agoemail: Optimised block_statemach() functions
Steve Holme [Thu, 7 Mar 2013 18:21:58 +0000 (18:21 +0000)]
email: Optimised block_statemach() functions

Optimised the result test in each of the block_statemach() functions.

11 years agoDOCS: Added the list command to the IMAP URL section
Steve Holme [Thu, 7 Mar 2013 11:51:40 +0000 (11:51 +0000)]
DOCS: Added the list command to the IMAP URL section

Added examples of the list command and clarified existing example URLs
following recent changes.

11 years agoFEATURES: Updated for recent imap additions
Steve Holme [Thu, 7 Mar 2013 11:03:16 +0000 (11:03 +0000)]
FEATURES: Updated for recent imap additions

Updated the imap features list, corrected a typo in the smtp features
and clarified a pop3 feature.

11 years agoversion bump: the next release will be 7.30.0
Daniel Stenberg [Thu, 7 Mar 2013 10:14:16 +0000 (11:14 +0100)]
version bump: the next release will be 7.30.0

11 years agochecksrc: ban unsafe functions
Daniel Stenberg [Wed, 6 Mar 2013 12:27:51 +0000 (13:27 +0100)]
checksrc: ban unsafe functions

The list of unsafe functions currently consists of sprintf, vsprintf,
strcat, strncat and gets.

Subsequently, some existing code needed updating to avoid warnings on
this.

11 years agoRELEASE-NOTES: Added missing imap fixes and additions
Steve Holme [Thu, 7 Mar 2013 10:03:28 +0000 (10:03 +0000)]
RELEASE-NOTES: Added missing imap fixes and additions

With all the recent imap changes it wasn't clear what new features and
fixes should be included in the release notes.

11 years agoRELEASE-NOTES: brought this up-to-date with the latest changes
Nick Zitzmann [Thu, 7 Mar 2013 03:03:18 +0000 (20:03 -0700)]
RELEASE-NOTES: brought this up-to-date with the latest changes

11 years agoimap: Fixed test801 and test1321 to specify a message UID
Jiri Hruska [Wed, 6 Mar 2013 21:19:17 +0000 (22:19 +0100)]
imap: Fixed test801 and test1321 to specify a message UID

Just a folder list would be retrieved if UID was not specified now.

11 years agoimap: Fixed ftpserver.pl to allow verification even through LIST command
Jiri Hruska [Wed, 6 Mar 2013 21:16:19 +0000 (22:16 +0100)]
imap: Fixed ftpserver.pl to allow verification even through LIST command

Commit 198012ee inadvertently broke LIST_imap().

11 years agoimap: Tidied up the APPEND and final APPEND response functions
Steve Holme [Wed, 6 Mar 2013 20:31:53 +0000 (20:31 +0000)]
imap: Tidied up the APPEND and final APPEND response functions

Removed unnecessary state changes on failure and setting of result codes
on success.

11 years agoimap: Tidied up the final FETCH response function
Steve Holme [Wed, 6 Mar 2013 20:19:46 +0000 (20:19 +0000)]
imap: Tidied up the final FETCH response function

Removed unnecessary state change on failure and setting of result code on
success.

11 years agoimap: Tidied up the LIST response function
Steve Holme [Wed, 6 Mar 2013 20:10:53 +0000 (20:10 +0000)]
imap: Tidied up the LIST response function

Reworked comments as they referenced custom commands, removed
unnecessary state change on failure and setting of result code on
success.

11 years agoimap: Removed the custom request response function
Steve Holme [Wed, 6 Mar 2013 19:58:34 +0000 (19:58 +0000)]
imap: Removed the custom request response function

Removed imap_state_custom_resp() as imap_state_list_resp() provides the
same functionality.

11 years agoimap: Updated ftpserver.pl to be more compliant, added new commands
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

11 years agoimap: Added check for empty UID in FETCH command
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().

11 years agonss: fix misplaced code enabling non-blocking socket mode
Kamil Dudka [Tue, 5 Mar 2013 16:51:01 +0000 (17:51 +0100)]
nss: fix misplaced code enabling non-blocking socket mode

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.

11 years agoimap: fix compiler warning
Daniel Stenberg [Wed, 6 Mar 2013 07:28:05 +0000 (08:28 +0100)]
imap: fix compiler warning

imap.c:694:21: error: unused variable 'imapc' [-Werror=unused-variable]

11 years agoimap: Added support for list command
Steve Holme [Tue, 5 Mar 2013 22:04:03 +0000 (22:04 +0000)]
imap: Added support for list command

11 years agoimap: Added list perform and response handler functions
Steve Holme [Tue, 5 Mar 2013 21:36:25 +0000 (21:36 +0000)]
imap: Added list perform and response handler functions

11 years agoimap: Introduced IMAP_LIST state
Steve Holme [Tue, 5 Mar 2013 21:34:53 +0000 (21:34 +0000)]
imap: Introduced IMAP_LIST state

11 years agoimap: Small tidy up of imap_select() to match imap_append()
Steve Holme [Tue, 5 Mar 2013 19:59:53 +0000 (19:59 +0000)]
imap: Small tidy up of imap_select() to match imap_append()

Updated the style of imap_select() before adding the LIST command.

11 years agoimap: Moved mailbox check from the imap_do() function
Steve Holme [Tue, 5 Mar 2013 19:52:11 +0000 (19:52 +0000)]
imap: Moved mailbox check from the imap_do() function

In preparation for the addition of the LIST command, moved the mailbox
check from imap_do() to imap_select() and imap_append().

11 years agocurl_setup.h: Added S_IRDIR() macro for compilers that don't support it
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.

11 years agoAddFormData: prevent only directories from being posted
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

11 years agodarwinssl: fix infinite loop if server disconnected abruptly
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

11 years agoimap: Added comments to imap_append()
Steve Holme [Sun, 3 Mar 2013 16:44:53 +0000 (16:44 +0000)]
imap: Added comments to imap_append()

11 years agoimap: Added required mailbox check for FETCH and APPEND commands
Jiri Hruska [Sun, 3 Mar 2013 10:37:10 +0000 (11:37 +0100)]
imap: Added required mailbox check for FETCH and APPEND commands

11 years agopingpong.c: Fix enumerated type mixed with another type
Steve Holme [Sun, 3 Mar 2013 13:55:01 +0000 (13:55 +0000)]
pingpong.c: Fix enumerated type mixed with another type

11 years agosmtp: Updated the coding style for state changes after a send operation
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.

11 years agopop3: Updated the coding style for state changes after a send operation
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.

11 years agoimap: Fixed typo in variable assignment
Steve Holme [Sun, 3 Mar 2013 13:13:59 +0000 (13:13 +0000)]
imap: Fixed typo in variable assignment

11 years agoimap: Fixed custom request handling in imap_done()
Jiri Hruska [Sun, 3 Mar 2013 10:33:53 +0000 (11:33 +0100)]
imap: Fixed custom request handling in imap_done()

Fixed imap_done() so that neither the FINAL states are not entered when
a custom command has been performed.

11 years agoimap: Enabled custom requests in imap_select_resp()
Jiri Hruska [Sun, 3 Mar 2013 10:27:18 +0000 (11:27 +0100)]
imap: Enabled custom requests in imap_select_resp()

Changed imap_select_resp() to invoke imap_custom() instead of
imap_fetch() after the mailbox has been selected if a custom
command has been set.

11 years agoimap: Enabled custom requests in imap_perform()
Jiri Hruska [Sun, 3 Mar 2013 10:21:29 +0000 (11:21 +0100)]
imap: Enabled custom requests in imap_perform()

Modified imap_perform() to start with the custom command instead of
SELECT when a custom command is to be performed and no mailbox has
been given.

11 years agoimap: Added custom request perform and response handler functions
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.

11 years agopop3: Fixed unnecessary parent structure reference
Steve Holme [Sun, 3 Mar 2013 11:10:24 +0000 (11:10 +0000)]
pop3: Fixed unnecessary parent structure reference

Updated pop3 code following recent imap changes.

11 years agoimap: Added custom request parsing
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.

11 years agoimap: Introduced custom request parameters
Jiri Hruska [Sun, 3 Mar 2013 09:12:27 +0000 (10:12 +0100)]
imap: Introduced custom request parameters

Added custom request parameters to the per-request structure.

11 years agoimap: Introduced IMAP_CUSTOM state
Jiri Hruska [Sun, 3 Mar 2013 09:10:01 +0000 (10:10 +0100)]
imap: Introduced IMAP_CUSTOM state

11 years agoimap: Minor code tidy up
Steve Holme [Sat, 2 Mar 2013 21:22:44 +0000 (21:22 +0000)]
imap: Minor code tidy up

Minor tidy up of code layout and comments following recent changes.

11 years agoimap: Simplified the imap_state_append_resp() function
Steve Holme [Sat, 2 Mar 2013 20:40:38 +0000 (20:40 +0000)]
imap: Simplified the imap_state_append_resp() function

Introduced the result code variable to simplify the state changes and
remove the hard returns.

11 years agoimap: Changed successful response logic in imap_state_append_resp()
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.

11 years agoimap: Standardised imapcode condition tests
Steve Holme [Sat, 2 Mar 2013 20:29:27 +0000 (20:29 +0000)]
imap: Standardised imapcode condition tests

For consistency changed two if(constant != imapcode) tests to be
if(imapcode != constant).

11 years agoimap: Moved imap_append() to be with the other perform functions
Steve Holme [Sat, 2 Mar 2013 20:24:49 +0000 (20:24 +0000)]
imap: Moved imap_append() to be with the other perform functions