1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 17:31:46 -05:00

email: Tidied up the *_regular_transfer() functions

Added comments and simplified convoluted dophase_done comparison.
This commit is contained in:
Steve Holme 2013-03-08 23:25:04 +00:00
parent e5bb4e86ac
commit f691f9609c
3 changed files with 12 additions and 18 deletions

View File

@ -2222,20 +2222,18 @@ static CURLcode imap_regular_transfer(struct connectdata *conn,
/* Make sure size is unknown at this point */ /* Make sure size is unknown at this point */
data->req.size = -1; data->req.size = -1;
/* Set the progress data */
Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetUploadCounter(data, 0);
Curl_pgrsSetDownloadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0);
Curl_pgrsSetUploadSize(data, 0); Curl_pgrsSetUploadSize(data, 0);
Curl_pgrsSetDownloadSize(data, 0); Curl_pgrsSetDownloadSize(data, 0);
/* Carry out the perform */
result = imap_perform(conn, &connected, dophase_done); result = imap_perform(conn, &connected, dophase_done);
if(!result) { /* Perform post DO phase operations if necessary */
if(!*dophase_done) if(!result && *dophase_done)
/* The DO phase has not completed yet */
return CURLE_OK;
result = imap_dophase_done(conn, connected); result = imap_dophase_done(conn, connected);
}
return result; return result;
} }

View File

@ -1594,20 +1594,18 @@ static CURLcode pop3_regular_transfer(struct connectdata *conn,
/* Make sure size is unknown at this point */ /* Make sure size is unknown at this point */
data->req.size = -1; data->req.size = -1;
/* Set the progress data */
Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetUploadCounter(data, 0);
Curl_pgrsSetDownloadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0);
Curl_pgrsSetUploadSize(data, 0); Curl_pgrsSetUploadSize(data, 0);
Curl_pgrsSetDownloadSize(data, 0); Curl_pgrsSetDownloadSize(data, 0);
/* Carry out the perform */
result = pop3_perform(conn, &connected, dophase_done); result = pop3_perform(conn, &connected, dophase_done);
if(!result) { /* Perform post DO phase operations if necessary */
if(!*dophase_done) if(!result && *dophase_done)
/* The DO phase has not completed yet */
return CURLE_OK;
result = pop3_dophase_done(conn, connected); result = pop3_dophase_done(conn, connected);
}
return result; return result;
} }

View File

@ -1593,20 +1593,18 @@ static CURLcode smtp_regular_transfer(struct connectdata *conn,
/* Make sure size is unknown at this point */ /* Make sure size is unknown at this point */
data->req.size = -1; data->req.size = -1;
/* Set the progress data */
Curl_pgrsSetUploadCounter(data, 0); Curl_pgrsSetUploadCounter(data, 0);
Curl_pgrsSetDownloadCounter(data, 0); Curl_pgrsSetDownloadCounter(data, 0);
Curl_pgrsSetUploadSize(data, 0); Curl_pgrsSetUploadSize(data, 0);
Curl_pgrsSetDownloadSize(data, 0); Curl_pgrsSetDownloadSize(data, 0);
/* Carry out the perform */
result = smtp_perform(conn, &connected, dophase_done); result = smtp_perform(conn, &connected, dophase_done);
if(!result) { /* Perform post DO phase operations if necessary */
if(!*dophase_done) if(!result && *dophase_done)
/* The DO phase has not completed yet */
return CURLE_OK;
result = smtp_dophase_done(conn, connected); result = smtp_dophase_done(conn, connected);
}
return result; return result;
} }