diff options
author | Kamil Dudka <kdudka@redhat.com> | 2010-11-19 13:43:20 +0100 |
---|---|---|
committer | Kamil Dudka <kdudka@redhat.com> | 2010-12-06 14:35:42 +0100 |
commit | 5c7c9a768d009319520142fcaee1dea33625060f (patch) | |
tree | a8c31c739426e32edb76d9b86be951d9cb1191da /lib/pop3.c | |
parent | bf1c102b80698e60972063b269f61ccbe2bfeaa8 (diff) |
url: provide dead_connection flag in Curl_handler::disconnect
It helps to prevent a hangup with some FTP servers in case idle session
timeout has exceeded. But it may be useful also for other protocols
that send any quit message on disconnect. Currently used by FTP, POP3,
IMAP and SMTP.
Diffstat (limited to 'lib/pop3.c')
-rw-r--r-- | lib/pop3.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pop3.c b/lib/pop3.c index 9609b6249..9f6744363 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -101,7 +101,7 @@ static CURLcode pop3_do(struct connectdata *conn, bool *done); static CURLcode pop3_done(struct connectdata *conn, CURLcode, bool premature); static CURLcode pop3_connect(struct connectdata *conn, bool *done); -static CURLcode pop3_disconnect(struct connectdata *conn); +static CURLcode pop3_disconnect(struct connectdata *conn, bool dead_connection); static CURLcode pop3_multi_statemach(struct connectdata *conn, bool *done); static int pop3_getsock(struct connectdata *conn, curl_socket_t *socks, @@ -817,7 +817,7 @@ static CURLcode pop3_quit(struct connectdata *conn) * Disconnect from an POP3 server. Cleanup protocol-specific per-connection * resources. BLOCKING. */ -static CURLcode pop3_disconnect(struct connectdata *conn) +static CURLcode pop3_disconnect(struct connectdata *conn, bool dead_connection) { struct pop3_conn *pop3c= &conn->proto.pop3c; @@ -828,7 +828,7 @@ static CURLcode pop3_disconnect(struct connectdata *conn) /* The POP3 session may or may not have been allocated/setup at this point! */ - if(pop3c->pp.conn) + if(!dead_connection && pop3c->pp.conn) (void)pop3_quit(conn); /* ignore errors on the LOGOUT */ |