will try to send the QUIT command, otherwise it will just return.
*/
ftpc->shutdown = TRUE;
- if(dead_connection)
+ if(dead_connection || Curl_pp_needs_flush(data, &ftpc->pp))
ftpc->ctl_valid = FALSE;
/* The FTP session may or may not have been allocated/setup at this point! */
(void)data;
if(imapc) {
/* 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 (pingpong has pending data to send),
+ sending quit and waiting around here will make the
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! */
- if(!dead_connection && conn->bits.protoconnstart) {
+ if(!dead_connection && conn->bits.protoconnstart &&
+ !Curl_pp_needs_flush(data, &imapc->pp)) {
if(!imap_perform_logout(data, imapc))
(void)imap_block_statemach(data, imapc, TRUE); /* ignore errors */
}
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. */
- if(!dead_connection && conn->bits.protoconnstart) {
+ if(!dead_connection && conn->bits.protoconnstart &&
+ !Curl_pp_needs_flush(data, &pop3c->pp)) {
if(!pop3_perform_quit(data, conn))
(void)pop3_block_statemach(data, conn, TRUE); /* ignore errors on QUIT */
}
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. */
- if(!dead_connection && conn->bits.protoconnstart) {
+ if(!dead_connection && conn->bits.protoconnstart &&
+ !Curl_pp_needs_flush(data, &smtpc->pp)) {
if(!smtp_perform_quit(data, smtpc))
(void)smtp_block_statemach(data, smtpc, TRUE); /* ignore on QUIT */
}