int numsocks);
static CURLcode smtp_doing(struct connectdata *conn,
bool *dophase_done);
-static CURLcode smtp_setup_connection(struct connectdata * conn);
+static CURLcode smtp_setup_connection(struct connectdata *conn);
static CURLcode smtp_state_upgrade_tls(struct connectdata *conn);
/*
#ifndef CURL_DISABLE_CRYPTO_AUTH
if(smtpc->authmechs & SMTP_AUTH_CRAM_MD5) {
mech = "CRAM-MD5";
- state1 = SMTP_AUTHCRAM;
+ state1 = SMTP_AUTHCRAMMD5;
smtpc->authused = SMTP_AUTH_CRAM_MD5;
}
else
{
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
- char * chlg64 = data->state.buffer;
- unsigned char * chlg;
+ char *chlg64 = data->state.buffer;
+ unsigned char *chlg;
size_t chlglen;
size_t len = 0;
char *rplyb64 = NULL;
break;
#ifndef CURL_DISABLE_CRYPTO_AUTH
- case SMTP_AUTHCRAM:
+ case SMTP_AUTHCRAMMD5:
result = smtp_state_authcram_resp(conn, smtpcode, smtpc->state);
break;
#endif
path = "localhost";
}
- /* url decode the path and use it as domain with EHLO */
+ /* Url decode the path and use it as the domain in our EHLO */
result = Curl_urldecode(conn->data, path, 0, &smtpc->domain, NULL, TRUE);
if(result)
return result;
- /* When we connect, we start in the state where we await the server greeting
- */
+ /* Set the state as we are waiting the server greeting */
state(conn, SMTP_SERVERGREET);
if(data->state.used_interface == Curl_if_multi)
if(status) {
conn->bits.close = TRUE; /* marked for closure */
- result = status; /* use the already set error code */
+ result = status; /* use the already set error code */
}
else if(!data->set.connect_only) {
struct smtp_conn *smtpc = &conn->proto.smtpc;
* This is the actual DO function for SMTP. Get a file/directory according to
* the options previously setup.
*/
-
static
CURLcode smtp_perform(struct connectdata *conn,
bool *connected, /* connect status after PASV / PORT */
* Performs all commands done before a regular transfer between a local and a
* remote host.
*/
-static
-CURLcode smtp_regular_transfer(struct connectdata *conn,
- bool *dophase_done)
+static CURLcode smtp_regular_transfer(struct connectdata *conn,
+ bool *dophase_done)
{
CURLcode result = CURLE_OK;
bool connected = FALSE;
return CURLE_UNSUPPORTED_PROTOCOL;
#endif
}
- /*
- * We explicitly mark this connection as persistent here as we're doing
+
+ /* We explicitly mark this connection as persistent here as we're doing
* SMTP over HTTP and thus we accidentally avoid setting this value
* otherwise.
*/
failf (data, "Failed to alloc scratch buffer!");
return CURLE_OUT_OF_MEMORY;
}
+
/* This loop can be improved by some kind of Boyer-Moore style of
approach but that is saved for later... */
for(i = 0, si = 0; i < nread; i++) {
-
if(SMTP_EOB[smtpc->eob] == data->req.upload_fromhere[i])
smtpc->eob++;
else if(smtpc->eob) {
}
else if(!smtpc->eob)
data->state.scratch[si++] = data->req.upload_fromhere[i];
-
- } /* for() */
+ }
if(si != nread) {
/* only use the new buffer if we replaced something */