*/
static CURLcode imap_sendf(struct connectdata *conn, const char *fmt, ...)
{
- CURLcode result;
+ CURLcode result = CURLE_OK;
struct imap_conn *imapc = &conn->proto.imapc;
char *taggedfmt;
va_list ap;
static CURLcode imap_state_upgrade_tls(struct connectdata *conn)
{
+ CURLcode result = CURLE_OK;
struct imap_conn *imapc = &conn->proto.imapc;
- CURLcode result;
/* Start the SSL connection */
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone);
static CURLcode imap_statemach_act(struct connectdata *conn)
{
- CURLcode result;
+ CURLcode result = CURLE_OK;
curl_socket_t sock = conn->sock[FIRSTSOCKET];
int imapcode;
struct imap_conn *imapc = &conn->proto.imapc;
/* Called repeatedly until done from multi.c */
static CURLcode imap_multi_statemach(struct connectdata *conn, bool *done)
{
+ CURLcode result = CURLE_OK;
struct imap_conn *imapc = &conn->proto.imapc;
- CURLcode result;
if((conn->handler->flags & PROTOPT_SSL) && !imapc->ssldone)
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone);
static CURLcode imap_block_statemach(struct connectdata *conn)
{
- struct imap_conn *imapc = &conn->proto.imapc;
- struct pingpong *pp = &imapc->pp;
CURLcode result = CURLE_OK;
+ struct imap_conn *imapc = &conn->proto.imapc;
while(imapc->state != IMAP_STOP) {
- result = Curl_pp_statemach(pp, TRUE);
+ result = Curl_pp_statemach(&imapc->pp, TRUE);
if(result)
break;
}
*/
static CURLcode imap_connect(struct connectdata *conn, bool *done)
{
- CURLcode result;
+ CURLcode result = CURLE_OK;
struct imap_conn *imapc = &conn->proto.imapc;
struct pingpong *pp = &imapc->pp;
static CURLcode imap_done(struct connectdata *conn, CURLcode status,
bool premature)
{
+ CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
struct FTP *imap = data->state.proto.imap;
- CURLcode result=CURLE_OK;
(void)premature;
*/
static CURLcode imap_do(struct connectdata *conn, bool *done)
{
- CURLcode retcode = CURLE_OK;
+ CURLcode result = CURLE_OK;
*done = FALSE; /* default to false */
the struct IMAP is allocated and setup in the imap_connect() function.
*/
Curl_reset_reqproto(conn);
- retcode = imap_init(conn);
- if(retcode)
- return retcode;
+ result = imap_init(conn);
+ if(result)
+ return result;
/* Parse the URL path */
- retcode = imap_parse_url_path(conn);
- if(retcode)
- return retcode;
+ result = imap_parse_url_path(conn);
+ if(result)
+ return result;
- retcode = imap_regular_transfer(conn, done);
+ result = imap_regular_transfer(conn, done);
- return retcode;
+ return result;
}
/***********************************************************************
static CURLcode pop3_state_upgrade_tls(struct connectdata *conn)
{
+ CURLcode result = CURLE_OK;
struct pop3_conn *pop3c = &conn->proto.pop3c;
- CURLcode result;
/* Start the SSL connection */
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &pop3c->ssldone);
static CURLcode pop3_statemach_act(struct connectdata *conn)
{
- CURLcode result;
+ CURLcode result = CURLE_OK;
curl_socket_t sock = conn->sock[FIRSTSOCKET];
int pop3code;
struct pop3_conn *pop3c = &conn->proto.pop3c;
/* Called repeatedly until done from multi.c */
static CURLcode pop3_multi_statemach(struct connectdata *conn, bool *done)
{
+ CURLcode result = CURLE_OK;
struct pop3_conn *pop3c = &conn->proto.pop3c;
- CURLcode result;
if((conn->handler->flags & PROTOPT_SSL) && !pop3c->ssldone)
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &pop3c->ssldone);
static CURLcode pop3_block_statemach(struct connectdata *conn)
{
- struct pop3_conn *pop3c = &conn->proto.pop3c;
- struct pingpong *pp = &pop3c->pp;
CURLcode result = CURLE_OK;
+ struct pop3_conn *pop3c = &conn->proto.pop3c;
while(pop3c->state != POP3_STOP) {
- result = Curl_pp_statemach(pp, TRUE);
+ result = Curl_pp_statemach(&pop3c->pp, TRUE);
if(result)
break;
}
*/
static CURLcode pop3_connect(struct connectdata *conn, bool *done)
{
- CURLcode result;
+ CURLcode result = CURLE_OK;
struct pop3_conn *pop3c = &conn->proto.pop3c;
struct pingpong *pp = &pop3c->pp;
static CURLcode pop3_done(struct connectdata *conn, CURLcode status,
bool premature)
{
+ CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
struct FTP *pop3 = data->state.proto.pop3;
struct pop3_conn *pop3c = &conn->proto.pop3c;
- CURLcode result = CURLE_OK;
(void)premature;
*/
static CURLcode pop3_do(struct connectdata *conn, bool *done)
{
- CURLcode retcode = CURLE_OK;
+ CURLcode result = CURLE_OK;
*done = FALSE; /* default to false */
the struct POP3 is allocated and setup in the pop3_connect() function.
*/
Curl_reset_reqproto(conn);
- retcode = pop3_init(conn);
- if(retcode)
- return retcode;
+ result = pop3_init(conn);
+ if(result)
+ return result;
/* Parse the URL path */
- retcode = pop3_parse_url_path(conn);
- if(retcode)
- return retcode;
+ result = pop3_parse_url_path(conn);
+ if(result)
+ return result;
/* Parse the custom request */
- retcode = pop3_parse_custom_request(conn);
- if(retcode)
- return retcode;
+ result = pop3_parse_custom_request(conn);
+ if(result)
+ return result;
- retcode = pop3_regular_transfer(conn, done);
+ result = pop3_regular_transfer(conn, done);
- return retcode;
+ return result;
}
/***********************************************************************
static CURLcode smtp_state_ehlo(struct connectdata *conn)
{
- CURLcode result;
+ CURLcode result = CURLE_OK;
struct smtp_conn *smtpc = &conn->proto.smtpc;
smtpc->authmechs = 0; /* No known authentication mechanisms yet */
static CURLcode smtp_state_helo(struct connectdata *conn)
{
- CURLcode result;
+ CURLcode result = CURLE_OK;
struct smtp_conn *smtpc = &conn->proto.smtpc;
smtpc->authused = 0; /* No authentication mechanism used in smtp
static CURLcode smtp_state_upgrade_tls(struct connectdata *conn)
{
+ CURLcode result = CURLE_OK;
struct smtp_conn *smtpc = &conn->proto.smtpc;
- CURLcode result;
/* Start the SSL connection */
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &smtpc->ssldone);
{
CURLcode result = CURLE_OK;
struct smtp_conn *smtpc = &conn->proto.smtpc;
- char *initresp = NULL;
const char *mech = NULL;
+ char *initresp = NULL;
size_t len = 0;
smtpstate state1 = SMTP_STOP;
smtpstate state2 = SMTP_STOP;
static CURLcode smtp_statemach_act(struct connectdata *conn)
{
- CURLcode result;
+ CURLcode result = CURLE_OK;
curl_socket_t sock = conn->sock[FIRSTSOCKET];
struct SessionHandle *data = conn->data;
int smtpcode;
/* Called repeatedly until done from multi.c */
static CURLcode smtp_multi_statemach(struct connectdata *conn, bool *done)
{
+ CURLcode result = CURLE_OK;
struct smtp_conn *smtpc = &conn->proto.smtpc;
- CURLcode result;
if((conn->handler->flags & PROTOPT_SSL) && !smtpc->ssldone)
result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &smtpc->ssldone);
static CURLcode smtp_block_statemach(struct connectdata *conn)
{
- struct smtp_conn *smtpc = &conn->proto.smtpc;
- struct pingpong *pp = &smtpc->pp;
CURLcode result = CURLE_OK;
+ struct smtp_conn *smtpc = &conn->proto.smtpc;
while(smtpc->state != SMTP_STOP) {
- result = Curl_pp_statemach(pp, TRUE);
+ result = Curl_pp_statemach(&smtpc->pp, TRUE);
if(result)
break;
}
*/
static CURLcode smtp_connect(struct connectdata *conn, bool *done)
{
- CURLcode result;
+ CURLcode result = CURLE_OK;
struct smtp_conn *smtpc = &conn->proto.smtpc;
struct pingpong *pp = &smtpc->pp;
const char *path = conn->data->state.path;
static CURLcode smtp_done(struct connectdata *conn, CURLcode status,
bool premature)
{
+ CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
struct FTP *smtp = data->state.proto.smtp;
- CURLcode result = CURLE_OK;
ssize_t bytes_written;
(void)premature;
*/
static CURLcode smtp_do(struct connectdata *conn, bool *done)
{
- CURLcode retcode = CURLE_OK;
+ CURLcode result = CURLE_OK;
*done = FALSE; /* default to false */
the struct SMTP is allocated and setup in the smtp_connect() function.
*/
Curl_reset_reqproto(conn);
- retcode = smtp_init(conn);
- if(retcode)
- return retcode;
+ result = smtp_init(conn);
+ if(result)
+ return result;
- retcode = smtp_regular_transfer(conn, done);
+ result = smtp_regular_transfer(conn, done);
- return retcode;
+ return result;
}
/***********************************************************************