aboutsummaryrefslogtreecommitdiff
path: root/lib/imap.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-08-05 10:32:08 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-08-12 13:17:57 +0200
commite79535bc5e8e25df8415b6b23671cbd8bd3c83a5 (patch)
treedf811d60b9433abd50856a9f62ee7bb8a3d9cfeb /lib/imap.c
parent4ad8e142da463ab208d5b5565e53291c8e5ef038 (diff)
SessionHandle: the protocol specific pointer is now a void *
All protocol handler structs are now opaque (void *) in the SessionHandle struct and moved in the request-specific sub-struct 'SingleRequest'. The intension is to keep the protocol specific knowledge in their own dedicated source files [protocol].c etc. There's some "leakage" where this policy is violated, to be addressed at a later point in time.
Diffstat (limited to 'lib/imap.c')
-rw-r--r--lib/imap.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/imap.c b/lib/imap.c
index c1dffb41d..13a11d0b0 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -268,7 +268,7 @@ static bool imap_matchresp(const char *line, size_t len, const char *cmd)
static bool imap_endofresp(struct connectdata *conn, char *line, size_t len,
int *resp)
{
- struct IMAP *imap = conn->data->state.proto.imap;
+ struct IMAP *imap = conn->data->req.protop;
struct imap_conn *imapc = &conn->proto.imapc;
const char *id = imapc->resptag;
size_t id_len = strlen(id);
@@ -638,7 +638,7 @@ static CURLcode imap_perform_list(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct IMAP *imap = data->state.proto.imap;
+ struct IMAP *imap = data->req.protop;
char *mailbox;
if(imap->custom)
@@ -673,7 +673,7 @@ static CURLcode imap_perform_select(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct IMAP *imap = data->state.proto.imap;
+ struct IMAP *imap = data->req.protop;
struct imap_conn *imapc = &conn->proto.imapc;
char *mailbox;
@@ -712,7 +712,7 @@ static CURLcode imap_perform_select(struct connectdata *conn)
static CURLcode imap_perform_fetch(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct IMAP *imap = conn->data->state.proto.imap;
+ struct IMAP *imap = conn->data->req.protop;
/* Check we have a UID */
if(!imap->uid) {
@@ -740,7 +740,7 @@ static CURLcode imap_perform_fetch(struct connectdata *conn)
static CURLcode imap_perform_append(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
- struct IMAP *imap = conn->data->state.proto.imap;
+ struct IMAP *imap = conn->data->req.protop;
char *mailbox;
/* Check we have a mailbox */
@@ -1316,7 +1316,7 @@ static CURLcode imap_state_select_resp(struct connectdata *conn, int imapcode,
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct IMAP *imap = conn->data->state.proto.imap;
+ struct IMAP *imap = conn->data->req.protop;
struct imap_conn *imapc = &conn->proto.imapc;
const char *line = data->state.buffer;
char tmp[20];
@@ -1671,7 +1671,7 @@ static CURLcode imap_init(struct connectdata *conn)
struct SessionHandle *data = conn->data;
struct IMAP *imap;
- imap = data->state.proto.imap = calloc(sizeof(struct IMAP), 1);
+ imap = data->req.protop = calloc(sizeof(struct IMAP), 1);
if(!imap)
result = CURLE_OUT_OF_MEMORY;
@@ -1748,7 +1748,7 @@ static CURLcode imap_done(struct connectdata *conn, CURLcode status,
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct IMAP *imap = data->state.proto.imap;
+ struct IMAP *imap = data->req.protop;
(void)premature;
@@ -1813,7 +1813,7 @@ static CURLcode imap_perform(struct connectdata *conn, bool *connected,
/* This is IMAP and no proxy */
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct IMAP *imap = data->state.proto.imap;
+ struct IMAP *imap = data->req.protop;
struct imap_conn *imapc = &conn->proto.imapc;
bool selected = FALSE;
@@ -1932,7 +1932,7 @@ static CURLcode imap_disconnect(struct connectdata *conn, bool dead_connection)
/* Call this when the DO phase has completed */
static CURLcode imap_dophase_done(struct connectdata *conn, bool connected)
{
- struct IMAP *imap = conn->data->state.proto.imap;
+ struct IMAP *imap = conn->data->req.protop;
(void)connected;
@@ -2242,7 +2242,7 @@ static CURLcode imap_parse_url_path(struct connectdata *conn)
/* The imap struct is already initialised in imap_connect() */
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct IMAP *imap = data->state.proto.imap;
+ struct IMAP *imap = data->req.protop;
const char *begin = data->state.path;
const char *ptr = begin;
@@ -2350,7 +2350,7 @@ static CURLcode imap_parse_custom_request(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct IMAP *imap = data->state.proto.imap;
+ struct IMAP *imap = data->req.protop;
const char *custom = data->set.str[STRING_CUSTOMREQUEST];
if(custom) {