aboutsummaryrefslogtreecommitdiff
path: root/lib/ssh.c
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2010-11-19 13:43:20 +0100
committerKamil Dudka <kdudka@redhat.com>2010-12-06 14:35:42 +0100
commit5c7c9a768d009319520142fcaee1dea33625060f (patch)
treea8c31c739426e32edb76d9b86be951d9cb1191da /lib/ssh.c
parentbf1c102b80698e60972063b269f61ccbe2bfeaa8 (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/ssh.c')
-rw-r--r--lib/ssh.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index 81f5f6420..ffcb48b42 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -135,13 +135,13 @@ static CURLcode scp_done(struct connectdata *conn,
CURLcode, bool premature);
static CURLcode scp_doing(struct connectdata *conn,
bool *dophase_done);
-static CURLcode scp_disconnect(struct connectdata *conn);
+static CURLcode scp_disconnect(struct connectdata *conn, bool dead_connection);
static CURLcode sftp_done(struct connectdata *conn,
CURLcode, bool premature);
static CURLcode sftp_doing(struct connectdata *conn,
bool *dophase_done);
-static CURLcode sftp_disconnect(struct connectdata *conn);
+static CURLcode sftp_disconnect(struct connectdata *conn, bool dead_connection);
static
CURLcode sftp_perform(struct connectdata *conn,
bool *connected,
@@ -2689,10 +2689,11 @@ static CURLcode ssh_do(struct connectdata *conn, bool *done)
/* BLOCKING, but the function is using the state machine so the only reason
this is still blocking is that the multi interface code has no support for
disconnecting operations that takes a while */
-static CURLcode scp_disconnect(struct connectdata *conn)
+static CURLcode scp_disconnect(struct connectdata *conn, bool dead_connection)
{
CURLcode result = CURLE_OK;
struct ssh_conn *ssh = &conn->proto.sshc;
+ (void) dead_connection;
Curl_safefree(conn->data->state.proto.ssh);
conn->data->state.proto.ssh = NULL;
@@ -2853,9 +2854,10 @@ static CURLcode sftp_doing(struct connectdata *conn,
/* BLOCKING, but the function is using the state machine so the only reason
this is still blocking is that the multi interface code has no support for
disconnecting operations that takes a while */
-static CURLcode sftp_disconnect(struct connectdata *conn)
+static CURLcode sftp_disconnect(struct connectdata *conn, bool dead_connection)
{
CURLcode result = CURLE_OK;
+ (void) dead_connection;
DEBUGF(infof(conn->data, "SSH DISCONNECT starts now\n"));