aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/imap.c26
-rw-r--r--lib/pop3.c24
-rw-r--r--lib/smtp.c22
3 files changed, 33 insertions, 39 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 8687f71cd..4a5c3f806 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -538,7 +538,7 @@ static CURLcode imap_state_login(struct connectdata *conn)
user = imap_atom(conn->user);
passwd = imap_atom(conn->passwd);
- /* Send USER and password */
+ /* Send the LOGIN command */
result = imap_sendf(conn, "LOGIN %s %s", user ? user : "",
passwd ? passwd : "");
@@ -1460,11 +1460,10 @@ static CURLcode imap_done(struct connectdata *conn, CURLcode status,
(void)premature;
if(!imap)
- /* When the easy handle is removed from the multi while libcurl is still
- * trying to resolve the host name, it seems that the IMAP struct is not
- * yet initialized, but the removal action calls Curl_done() which calls
- * this function. So we simply return success if no IMAP pointer is set.
- */
+ /* When the easy handle is removed from the multi interface while libcurl
+ is still trying to resolve the host name, the IMAP struct is not yet
+ initialized. However, the removal action calls Curl_done() which in
+ turn calls this function, so we simply return success. */
return CURLE_OK;
if(status) {
@@ -1512,7 +1511,7 @@ static CURLcode imap_perform(struct connectdata *conn, bool *connected,
if(result)
return result;
- /* run the state-machine */
+ /* Run the state-machine */
result = imap_multi_statemach(conn, dophase_done);
*connected = conn->bits.tcpconnect[FIRSTSOCKET];
@@ -1538,12 +1537,10 @@ static CURLcode imap_do(struct connectdata *conn, bool *done)
*done = FALSE; /* default to false */
- /*
- Since connections can be re-used between SessionHandles, this might be a
- connection already existing but on a fresh SessionHandle struct so we must
- make sure we have a good 'struct IMAP' to play with. For new connections,
- the struct IMAP is allocated and setup in the imap_connect() function.
- */
+ /* Since connections can be re-used between SessionHandles, there might be a
+ connection already existing but on a fresh SessionHandle struct. As such
+ we make sure we have a good IMAP struct to play with. For new connections
+ the IMAP struct is allocated and setup in the imap_connect() function. */
Curl_reset_reqproto(conn);
result = imap_init(conn);
if(result)
@@ -1572,6 +1569,7 @@ static CURLcode imap_logout(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
+ /* Send the LOGOUT command */
result = imap_sendf(conn, "LOGOUT", NULL);
if(result)
return result;
@@ -1596,7 +1594,7 @@ static CURLcode imap_disconnect(struct connectdata *conn, bool dead_connection)
/* We cannot send quit unconditionally. If this connection is stale or
bad in any way, sending quit and waiting around here will make the
- disconnect wait in vain and cause more problems than we need to */
+ disconnect wait in vain and cause more problems than we need to. */
/* The IMAP session may or may not have been allocated/setup at this
point! */
diff --git a/lib/pop3.c b/lib/pop3.c
index 89934b80a..04290f201 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -1374,11 +1374,10 @@ static CURLcode pop3_done(struct connectdata *conn, CURLcode status,
(void)premature;
if(!pop3)
- /* When the easy handle is removed from the multi while libcurl is still
- * trying to resolve the host name, it seems that the POP3 struct is not
- * yet initialized, but the removal action calls Curl_done() which calls
- * this function. So we simply return success if no POP3 pointer is set.
- */
+ /* When the easy handle is removed from the multi interface while libcurl
+ is still trying to resolve the host name, the POP3 struct is not yet
+ initialized. However, the removal action calls Curl_done() which in
+ turn calls this function, so we simply return success. */
return CURLE_OK;
if(status) {
@@ -1450,12 +1449,10 @@ static CURLcode pop3_do(struct connectdata *conn, bool *done)
*done = FALSE; /* default to false */
- /*
- Since connections can be re-used between SessionHandles, this might be a
- connection already existing but on a fresh SessionHandle struct so we must
- make sure we have a good 'struct POP3' to play with. For new connections,
- the struct POP3 is allocated and setup in the pop3_connect() function.
- */
+ /* Since connections can be re-used between SessionHandles, there might be a
+ connection already existing but on a fresh SessionHandle struct. As such
+ we make sure we have a good POP3 struct to play with. For new connections
+ the POP3 struct is allocated and setup in the pop3_connect() function. */
Curl_reset_reqproto(conn);
result = pop3_init(conn);
if(result)
@@ -1488,6 +1485,7 @@ static CURLcode pop3_quit(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
+ /* Send the QUIT command */
result = Curl_pp_sendf(&conn->proto.pop3c.pp, "QUIT", NULL);
if(result)
return result;
@@ -1513,7 +1511,7 @@ static CURLcode pop3_disconnect(struct connectdata *conn,
/* We cannot send quit unconditionally. If this connection is stale or
bad in any way, sending quit and waiting around here will make the
- disconnect wait in vain and cause more problems than we need to */
+ disconnect wait in vain and cause more problems than we need to. */
/* The POP3 session may or may not have been allocated/setup at this
point! */
@@ -1684,7 +1682,7 @@ CURLcode Curl_pop3_write(struct connectdata *conn, char *str, size_t nread)
5 bytes (0d 0a 2e 0d 0a). Note that a line starting with a dot matches
the eob so the server will have prefixed it with an extra dot which we
need to strip out. Additionally the marker could of course be spread out
- over 5 different data chunks */
+ over 5 different data chunks. */
for(i = 0; i < nread; i++) {
size_t prev = pop3c->eob;
diff --git a/lib/smtp.c b/lib/smtp.c
index ba219922a..729ee4caa 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -1384,11 +1384,10 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status,
(void)premature;
if(!smtp)
- /* When the easy handle is removed from the multi while libcurl is still
- * trying to resolve the host name, it seems that the SMTP struct is not
- * yet initialized, but the removal action calls Curl_done() which calls
- * this function. So we simply return success if no SMTP pointer is set.
- */
+ /* When the easy handle is removed from the multi interface while libcurl
+ is still trying to resolve the host name, the SMTP struct is not yet
+ initialized. However, the removal action calls Curl_done() which in
+ turn calls this function, so we simply return success. */
return CURLE_OK;
if(status) {
@@ -1492,12 +1491,10 @@ static CURLcode smtp_do(struct connectdata *conn, bool *done)
*done = FALSE; /* default to false */
- /*
- Since connections can be re-used between SessionHandles, this might be a
- connection already existing but on a fresh SessionHandle struct so we must
- make sure we have a good 'struct SMTP' to play with. For new connections,
- the struct SMTP is allocated and setup in the smtp_connect() function.
- */
+ /* Since connections can be re-used between SessionHandles, there might be a
+ connection already existing but on a fresh SessionHandle struct. As such
+ we make sure we have a good SMTP struct to play with. For new connections
+ the SMTP struct is allocated and setup in the smtp_connect() function. */
Curl_reset_reqproto(conn);
result = smtp_init(conn);
if(result)
@@ -1520,6 +1517,7 @@ static CURLcode smtp_quit(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
+ /* Send the QUIT command */
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "QUIT");
if(result)
return result;
@@ -1545,7 +1543,7 @@ static CURLcode smtp_disconnect(struct connectdata *conn,
/* We cannot send quit unconditionally. If this connection is stale or
bad in any way, sending quit and waiting around here will make the
- disconnect wait in vain and cause more problems than we need to */
+ disconnect wait in vain and cause more problems than we need to. */
/* The SMTP session may or may not have been allocated/setup at this
point! */