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 : "");
(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) {
if(result)
return result;
- /* run the state-machine */
+ /* Run the state-machine */
result = imap_multi_statemach(conn, dophase_done);
*connected = conn->bits.tcpconnect[FIRSTSOCKET];
*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)
{
CURLcode result = CURLE_OK;
+ /* Send the LOGOUT command */
result = imap_sendf(conn, "LOGOUT", NULL);
if(result)
return result;
/* 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! */
(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) {
*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)
{
CURLcode result = CURLE_OK;
+ /* Send the QUIT command */
result = Curl_pp_sendf(&conn->proto.pop3c.pp, "QUIT", NULL);
if(result)
return result;
/* 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! */
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;
(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) {
*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)
{
CURLcode result = CURLE_OK;
+ /* Send the QUIT command */
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "QUIT");
if(result)
return result;
/* 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! */