aboutsummaryrefslogtreecommitdiff
path: root/lib/smtp.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/smtp.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/smtp.c')
-rw-r--r--lib/smtp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index c1816e824..a56f54921 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -636,7 +636,7 @@ static CURLcode smtp_perform_rcpt_to(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct SMTP *smtp = data->state.proto.smtp;
+ struct SMTP *smtp = data->req.protop;
/* Send the RCPT TO command */
if(smtp->rcpt) {
@@ -1115,7 +1115,7 @@ static CURLcode smtp_state_mail_resp(struct connectdata *conn, int smtpcode,
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct SMTP *smtp = data->state.proto.smtp;
+ struct SMTP *smtp = data->req.protop;
(void)instate; /* no use for this yet */
@@ -1139,7 +1139,7 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode,
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct SMTP *smtp = data->state.proto.smtp;
+ struct SMTP *smtp = data->req.protop;
(void)instate; /* no use for this yet */
@@ -1363,7 +1363,7 @@ static CURLcode smtp_init(struct connectdata *conn)
struct SessionHandle *data = conn->data;
struct SMTP *smtp;
- smtp = data->state.proto.smtp = calloc(sizeof(struct SMTP), 1);
+ smtp = data->req.protop = calloc(sizeof(struct SMTP), 1);
if(!smtp)
result = CURLE_OUT_OF_MEMORY;
@@ -1442,7 +1442,7 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status,
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- struct SMTP *smtp = data->state.proto.smtp;
+ struct SMTP *smtp = data->req.protop;
struct pingpong *pp = &conn->proto.smtpc.pp;
const char *eob;
ssize_t len;
@@ -1523,7 +1523,7 @@ static CURLcode smtp_perform(struct connectdata *conn, bool *connected,
if(conn->data->set.opt_no_body) {
/* Requested no body means no transfer */
- struct SMTP *smtp = conn->data->state.proto.smtp;
+ struct SMTP *smtp = conn->data->req.protop;
smtp->transfer = FTPTRANSFER_INFO;
}
@@ -1602,7 +1602,7 @@ static CURLcode smtp_disconnect(struct connectdata *conn,
/* Call this when the DO phase has completed */
static CURLcode smtp_dophase_done(struct connectdata *conn, bool connected)
{
- struct SMTP *smtp = conn->data->state.proto.smtp;
+ struct SMTP *smtp = conn->data->req.protop;
(void)connected;
@@ -1785,7 +1785,7 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread)
ssize_t i;
ssize_t si;
struct SessionHandle *data = conn->data;
- struct SMTP *smtp = data->state.proto.smtp;
+ struct SMTP *smtp = data->req.protop;
/* Do we need to allocate the scatch buffer? */
if(!data->state.scratch) {