imap: Introduced a custom IMAP structure for per-request data

Created a new IMAP structure and changed the type of the imap proto
variable in connectdata from FTP* to the new IMAP*.

Moved the mailbox variable from the per-connection struct imap_conn to
the new per-request struct and fixed references accordingly.
This commit is contained in:
Jiri Hruska
2013-02-23 10:29:40 +01:00
committed by Steve Holme
parent 3906353b41
commit 2476b34b95
3 changed files with 27 additions and 15 deletions

View File

@@ -23,6 +23,7 @@
***************************************************************************/
#include "pingpong.h"
#include "ftp.h"
/****************************************************************************
* IMAP unique setup
@@ -51,11 +52,22 @@ typedef enum {
IMAP_LAST /* never used */
} imapstate;
/* This IMAP struct is used in the SessionHandle. All IMAP data that is
connection-oriented must be in imap_conn to properly deal with the fact that
perhaps the SessionHandle is changed between the times the connection is
used. */
struct IMAP {
curl_off_t *bytecountp;
char *user; /* User name string */
char *passwd; /* Password string */
curl_ftptransfer transfer;
char *mailbox; /* Mailbox to select */
};
/* imap_conn is used for struct connection-oriented data in the connectdata
struct */
struct imap_conn {
struct pingpong pp;
char *mailbox; /* Mailbox to select */
unsigned int authmechs; /* Accepted authentication mechanisms */
unsigned int authused; /* Auth mechanism used for the connection */
imapstate state; /* Always use imap.c:state() to change state! */