diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-12-14 09:21:47 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-12-17 12:33:00 +0100 |
commit | 154a17b6ee5097642e2330fb14ba52e317b95430 (patch) | |
tree | 51aa928bc4a5cecee4cde482e54ad89c5c080baf /lib/smtp.c | |
parent | 9e6518481cd4e2603b4f9e04d6cfd1a214a72726 (diff) | |
download | curl-154a17b6ee5097642e2330fb14ba52e317b95430.tar.gz |
pingpong: ignore regular timeout in disconnect phase
The timeout set with CURLOPT_TIMEOUT is no longer used when
disconnecting from one of the pingpong protocols (FTP, IMAP, SMTP,
POP3).
Reported-by: jasal82 on github
Fixes #3264
Closes #3374
Diffstat (limited to 'lib/smtp.c')
-rw-r--r-- | lib/smtp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index 587562306..84fc68e41 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1080,19 +1080,20 @@ static CURLcode smtp_multi_statemach(struct connectdata *conn, bool *done) return result; } - result = Curl_pp_statemach(&smtpc->pp, FALSE); + result = Curl_pp_statemach(&smtpc->pp, FALSE, FALSE); *done = (smtpc->state == SMTP_STOP) ? TRUE : FALSE; return result; } -static CURLcode smtp_block_statemach(struct connectdata *conn) +static CURLcode smtp_block_statemach(struct connectdata *conn, + bool disconnecting) { CURLcode result = CURLE_OK; struct smtp_conn *smtpc = &conn->proto.smtpc; while(smtpc->state != SMTP_STOP && !result) - result = Curl_pp_statemach(&smtpc->pp, TRUE); + result = Curl_pp_statemach(&smtpc->pp, TRUE, disconnecting); return result; } @@ -1253,7 +1254,7 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status, the smtp_multi_statemach function but we have no general support for non-blocking DONE operations! */ - result = smtp_block_statemach(conn); + result = smtp_block_statemach(conn, FALSE); } /* Clear the transfer mode for the next request */ @@ -1360,7 +1361,7 @@ static CURLcode smtp_disconnect(struct connectdata *conn, bool dead_connection) point! */ if(!dead_connection && smtpc->pp.conn && smtpc->pp.conn->bits.protoconnstart) if(!smtp_perform_quit(conn)) - (void)smtp_block_statemach(conn); /* ignore errors on QUIT */ + (void)smtp_block_statemach(conn, TRUE); /* ignore errors on QUIT */ /* Disconnect from the server */ Curl_pp_disconnect(&smtpc->pp); |