From 2476b34b95596ec16aab09c85133bc7eddd8ca53 Mon Sep 17 00:00:00 2001 From: Jiri Hruska Date: Sat, 23 Feb 2013 10:29:40 +0100 Subject: 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. --- lib/imap.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/imap.h') diff --git a/lib/imap.h b/lib/imap.h index 31888529a..acec210b0 100644 --- a/lib/imap.h +++ b/lib/imap.h @@ -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! */ -- cgit v1.2.3