Loading lib/smtp.c +14 −18 Original line number Diff line number Diff line Loading @@ -427,7 +427,7 @@ static CURLcode smtp_authenticate(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 Loading Loading @@ -1146,7 +1146,7 @@ static CURLcode smtp_statemach_act(struct connectdata *conn) break; #ifndef CURL_DISABLE_CRYPTO_AUTH case SMTP_AUTHCRAM: case SMTP_AUTHCRAMMD5: result = smtp_state_authcram_resp(conn, smtpcode, smtpc->state); break; #endif Loading Loading @@ -1339,13 +1339,12 @@ static CURLcode smtp_connect(struct connectdata *conn, 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) Loading Loading @@ -1430,7 +1429,6 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status, * 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 */ Loading Loading @@ -1604,8 +1602,7 @@ static CURLcode smtp_doing(struct connectdata *conn, * Performs all commands done before a regular transfer between a local and a * remote host. */ static CURLcode smtp_regular_transfer(struct connectdata *conn, static CURLcode smtp_regular_transfer(struct connectdata *conn, bool *dophase_done) { CURLcode result = CURLE_OK; Loading Loading @@ -1654,8 +1651,8 @@ static CURLcode smtp_setup_connection(struct connectdata *conn) 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. */ Loading Loading @@ -1688,10 +1685,10 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread) 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) { Loading Loading @@ -1719,8 +1716,7 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread) } 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 */ Loading lib/smtp.h +2 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2009 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2009 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms Loading Loading @@ -39,7 +39,7 @@ typedef enum { SMTP_AUTHPLAIN, SMTP_AUTHLOGIN, SMTP_AUTHPASSWD, SMTP_AUTHCRAM, SMTP_AUTHCRAMMD5, SMTP_AUTHNTLM, SMTP_AUTHNTLM_TYPE2MSG, SMTP_AUTH, Loading Loading
lib/smtp.c +14 −18 Original line number Diff line number Diff line Loading @@ -427,7 +427,7 @@ static CURLcode smtp_authenticate(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 Loading Loading @@ -1146,7 +1146,7 @@ static CURLcode smtp_statemach_act(struct connectdata *conn) break; #ifndef CURL_DISABLE_CRYPTO_AUTH case SMTP_AUTHCRAM: case SMTP_AUTHCRAMMD5: result = smtp_state_authcram_resp(conn, smtpcode, smtpc->state); break; #endif Loading Loading @@ -1339,13 +1339,12 @@ static CURLcode smtp_connect(struct connectdata *conn, 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) Loading Loading @@ -1430,7 +1429,6 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status, * 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 */ Loading Loading @@ -1604,8 +1602,7 @@ static CURLcode smtp_doing(struct connectdata *conn, * Performs all commands done before a regular transfer between a local and a * remote host. */ static CURLcode smtp_regular_transfer(struct connectdata *conn, static CURLcode smtp_regular_transfer(struct connectdata *conn, bool *dophase_done) { CURLcode result = CURLE_OK; Loading Loading @@ -1654,8 +1651,8 @@ static CURLcode smtp_setup_connection(struct connectdata *conn) 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. */ Loading Loading @@ -1688,10 +1685,10 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread) 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) { Loading Loading @@ -1719,8 +1716,7 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread) } 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 */ Loading
lib/smtp.h +2 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 2009 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2009 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms Loading Loading @@ -39,7 +39,7 @@ typedef enum { SMTP_AUTHPLAIN, SMTP_AUTHLOGIN, SMTP_AUTHPASSWD, SMTP_AUTHCRAM, SMTP_AUTHCRAMMD5, SMTP_AUTHNTLM, SMTP_AUTHNTLM_TYPE2MSG, SMTP_AUTH, Loading