mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
email: Additional tidy up of comments following recent changes
This commit is contained in:
parent
0b795db731
commit
7f6c7331b2
26
lib/imap.c
26
lib/imap.c
@ -538,7 +538,7 @@ static CURLcode imap_state_login(struct connectdata *conn)
|
|||||||
user = imap_atom(conn->user);
|
user = imap_atom(conn->user);
|
||||||
passwd = imap_atom(conn->passwd);
|
passwd = imap_atom(conn->passwd);
|
||||||
|
|
||||||
/* Send USER and password */
|
/* Send the LOGIN command */
|
||||||
result = imap_sendf(conn, "LOGIN %s %s", user ? user : "",
|
result = imap_sendf(conn, "LOGIN %s %s", user ? user : "",
|
||||||
passwd ? passwd : "");
|
passwd ? passwd : "");
|
||||||
|
|
||||||
@ -1460,11 +1460,10 @@ static CURLcode imap_done(struct connectdata *conn, CURLcode status,
|
|||||||
(void)premature;
|
(void)premature;
|
||||||
|
|
||||||
if(!imap)
|
if(!imap)
|
||||||
/* When the easy handle is removed from the multi while libcurl is still
|
/* When the easy handle is removed from the multi interface while libcurl
|
||||||
* trying to resolve the host name, it seems that the IMAP struct is not
|
is still trying to resolve the host name, the IMAP struct is not yet
|
||||||
* yet initialized, but the removal action calls Curl_done() which calls
|
initialized. However, the removal action calls Curl_done() which in
|
||||||
* this function. So we simply return success if no IMAP pointer is set.
|
turn calls this function, so we simply return success. */
|
||||||
*/
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
|
|
||||||
if(status) {
|
if(status) {
|
||||||
@ -1512,7 +1511,7 @@ static CURLcode imap_perform(struct connectdata *conn, bool *connected,
|
|||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
/* run the state-machine */
|
/* Run the state-machine */
|
||||||
result = imap_multi_statemach(conn, dophase_done);
|
result = imap_multi_statemach(conn, dophase_done);
|
||||||
|
|
||||||
*connected = conn->bits.tcpconnect[FIRSTSOCKET];
|
*connected = conn->bits.tcpconnect[FIRSTSOCKET];
|
||||||
@ -1538,12 +1537,10 @@ static CURLcode imap_do(struct connectdata *conn, bool *done)
|
|||||||
|
|
||||||
*done = FALSE; /* default to false */
|
*done = FALSE; /* default to false */
|
||||||
|
|
||||||
/*
|
/* Since connections can be re-used between SessionHandles, there might be a
|
||||||
Since connections can be re-used between SessionHandles, this might be a
|
connection already existing but on a fresh SessionHandle struct. As such
|
||||||
connection already existing but on a fresh SessionHandle struct so we must
|
we make sure we have a good IMAP struct to play with. For new connections
|
||||||
make sure we have a good 'struct IMAP' to play with. For new connections,
|
the IMAP struct is allocated and setup in the imap_connect() function. */
|
||||||
the struct IMAP is allocated and setup in the imap_connect() function.
|
|
||||||
*/
|
|
||||||
Curl_reset_reqproto(conn);
|
Curl_reset_reqproto(conn);
|
||||||
result = imap_init(conn);
|
result = imap_init(conn);
|
||||||
if(result)
|
if(result)
|
||||||
@ -1572,6 +1569,7 @@ static CURLcode imap_logout(struct connectdata *conn)
|
|||||||
{
|
{
|
||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
|
|
||||||
|
/* Send the LOGOUT command */
|
||||||
result = imap_sendf(conn, "LOGOUT", NULL);
|
result = imap_sendf(conn, "LOGOUT", NULL);
|
||||||
if(result)
|
if(result)
|
||||||
return 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
|
/* We cannot send quit unconditionally. If this connection is stale or
|
||||||
bad in any way, sending quit and waiting around here will make the
|
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
|
/* The IMAP session may or may not have been allocated/setup at this
|
||||||
point! */
|
point! */
|
||||||
|
24
lib/pop3.c
24
lib/pop3.c
@ -1374,11 +1374,10 @@ static CURLcode pop3_done(struct connectdata *conn, CURLcode status,
|
|||||||
(void)premature;
|
(void)premature;
|
||||||
|
|
||||||
if(!pop3)
|
if(!pop3)
|
||||||
/* When the easy handle is removed from the multi while libcurl is still
|
/* When the easy handle is removed from the multi interface while libcurl
|
||||||
* trying to resolve the host name, it seems that the POP3 struct is not
|
is still trying to resolve the host name, the POP3 struct is not yet
|
||||||
* yet initialized, but the removal action calls Curl_done() which calls
|
initialized. However, the removal action calls Curl_done() which in
|
||||||
* this function. So we simply return success if no POP3 pointer is set.
|
turn calls this function, so we simply return success. */
|
||||||
*/
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
|
|
||||||
if(status) {
|
if(status) {
|
||||||
@ -1450,12 +1449,10 @@ static CURLcode pop3_do(struct connectdata *conn, bool *done)
|
|||||||
|
|
||||||
*done = FALSE; /* default to false */
|
*done = FALSE; /* default to false */
|
||||||
|
|
||||||
/*
|
/* Since connections can be re-used between SessionHandles, there might be a
|
||||||
Since connections can be re-used between SessionHandles, this might be a
|
connection already existing but on a fresh SessionHandle struct. As such
|
||||||
connection already existing but on a fresh SessionHandle struct so we must
|
we make sure we have a good POP3 struct to play with. For new connections
|
||||||
make sure we have a good 'struct POP3' to play with. For new connections,
|
the POP3 struct is allocated and setup in the pop3_connect() function. */
|
||||||
the struct POP3 is allocated and setup in the pop3_connect() function.
|
|
||||||
*/
|
|
||||||
Curl_reset_reqproto(conn);
|
Curl_reset_reqproto(conn);
|
||||||
result = pop3_init(conn);
|
result = pop3_init(conn);
|
||||||
if(result)
|
if(result)
|
||||||
@ -1488,6 +1485,7 @@ static CURLcode pop3_quit(struct connectdata *conn)
|
|||||||
{
|
{
|
||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
|
|
||||||
|
/* Send the QUIT command */
|
||||||
result = Curl_pp_sendf(&conn->proto.pop3c.pp, "QUIT", NULL);
|
result = Curl_pp_sendf(&conn->proto.pop3c.pp, "QUIT", NULL);
|
||||||
if(result)
|
if(result)
|
||||||
return 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
|
/* We cannot send quit unconditionally. If this connection is stale or
|
||||||
bad in any way, sending quit and waiting around here will make the
|
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
|
/* The POP3 session may or may not have been allocated/setup at this
|
||||||
point! */
|
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
|
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
|
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
|
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++) {
|
for(i = 0; i < nread; i++) {
|
||||||
size_t prev = pop3c->eob;
|
size_t prev = pop3c->eob;
|
||||||
|
|
||||||
|
22
lib/smtp.c
22
lib/smtp.c
@ -1384,11 +1384,10 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status,
|
|||||||
(void)premature;
|
(void)premature;
|
||||||
|
|
||||||
if(!smtp)
|
if(!smtp)
|
||||||
/* When the easy handle is removed from the multi while libcurl is still
|
/* When the easy handle is removed from the multi interface while libcurl
|
||||||
* trying to resolve the host name, it seems that the SMTP struct is not
|
is still trying to resolve the host name, the SMTP struct is not yet
|
||||||
* yet initialized, but the removal action calls Curl_done() which calls
|
initialized. However, the removal action calls Curl_done() which in
|
||||||
* this function. So we simply return success if no SMTP pointer is set.
|
turn calls this function, so we simply return success. */
|
||||||
*/
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
|
|
||||||
if(status) {
|
if(status) {
|
||||||
@ -1492,12 +1491,10 @@ static CURLcode smtp_do(struct connectdata *conn, bool *done)
|
|||||||
|
|
||||||
*done = FALSE; /* default to false */
|
*done = FALSE; /* default to false */
|
||||||
|
|
||||||
/*
|
/* Since connections can be re-used between SessionHandles, there might be a
|
||||||
Since connections can be re-used between SessionHandles, this might be a
|
connection already existing but on a fresh SessionHandle struct. As such
|
||||||
connection already existing but on a fresh SessionHandle struct so we must
|
we make sure we have a good SMTP struct to play with. For new connections
|
||||||
make sure we have a good 'struct SMTP' to play with. For new connections,
|
the SMTP struct is allocated and setup in the smtp_connect() function. */
|
||||||
the struct SMTP is allocated and setup in the smtp_connect() function.
|
|
||||||
*/
|
|
||||||
Curl_reset_reqproto(conn);
|
Curl_reset_reqproto(conn);
|
||||||
result = smtp_init(conn);
|
result = smtp_init(conn);
|
||||||
if(result)
|
if(result)
|
||||||
@ -1520,6 +1517,7 @@ static CURLcode smtp_quit(struct connectdata *conn)
|
|||||||
{
|
{
|
||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
|
|
||||||
|
/* Send the QUIT command */
|
||||||
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "QUIT");
|
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "QUIT");
|
||||||
if(result)
|
if(result)
|
||||||
return 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
|
/* We cannot send quit unconditionally. If this connection is stale or
|
||||||
bad in any way, sending quit and waiting around here will make the
|
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
|
/* The SMTP session may or may not have been allocated/setup at this
|
||||||
point! */
|
point! */
|
||||||
|
Loading…
Reference in New Issue
Block a user