mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 09:42:25 +00:00
SSH2 connections weren't closing cleanly after socket revamp. Fixed.
[originally from svn r754]
This commit is contained in:
parent
039103ff5d
commit
5ff9cc2f1f
12
ssh.c
12
ssh.c
@ -993,6 +993,13 @@ static int ssh_receive(Socket s, int urgent, char *data, int len) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
ssh_gotdata (data, len);
|
ssh_gotdata (data, len);
|
||||||
|
if (ssh_state == SSH_STATE_CLOSED) {
|
||||||
|
if (s) {
|
||||||
|
sk_close(s);
|
||||||
|
s = NULL;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1641,6 +1648,7 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt) {
|
|||||||
} else if (pktin.type == SSH1_MSG_DISCONNECT) {
|
} else if (pktin.type == SSH1_MSG_DISCONNECT) {
|
||||||
ssh_state = SSH_STATE_CLOSED;
|
ssh_state = SSH_STATE_CLOSED;
|
||||||
logevent("Received disconnect request");
|
logevent("Received disconnect request");
|
||||||
|
crReturnV;
|
||||||
} else if (pktin.type == SSH1_SMSG_AGENT_OPEN) {
|
} else if (pktin.type == SSH1_SMSG_AGENT_OPEN) {
|
||||||
/* Remote side is trying to open a channel to talk to our
|
/* Remote side is trying to open a channel to talk to our
|
||||||
* agent. Give them back a local channel number. */
|
* agent. Give them back a local channel number. */
|
||||||
@ -2402,6 +2410,7 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
|
|||||||
} else if (pktin.type == SSH2_MSG_DISCONNECT) {
|
} else if (pktin.type == SSH2_MSG_DISCONNECT) {
|
||||||
ssh_state = SSH_STATE_CLOSED;
|
ssh_state = SSH_STATE_CLOSED;
|
||||||
logevent("Received disconnect message");
|
logevent("Received disconnect message");
|
||||||
|
crReturnV;
|
||||||
} else if (pktin.type == SSH2_MSG_CHANNEL_REQUEST) {
|
} else if (pktin.type == SSH2_MSG_CHANNEL_REQUEST) {
|
||||||
continue; /* exit status et al; ignore (FIXME?) */
|
continue; /* exit status et al; ignore (FIXME?) */
|
||||||
} else if (pktin.type == SSH2_MSG_CHANNEL_EOF) {
|
} else if (pktin.type == SSH2_MSG_CHANNEL_EOF) {
|
||||||
@ -2419,8 +2428,7 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
|
|||||||
ssh2_pkt_init(SSH2_MSG_DISCONNECT);
|
ssh2_pkt_init(SSH2_MSG_DISCONNECT);
|
||||||
ssh2_pkt_send();
|
ssh2_pkt_send();
|
||||||
ssh_state = SSH_STATE_CLOSED;
|
ssh_state = SSH_STATE_CLOSED;
|
||||||
sk_close(s);
|
crReturnV;
|
||||||
s = NULL;
|
|
||||||
}
|
}
|
||||||
continue; /* remote sends close; ignore (FIXME) */
|
continue; /* remote sends close; ignore (FIXME) */
|
||||||
} else if (pktin.type == SSH2_MSG_CHANNEL_WINDOW_ADJUST) {
|
} else if (pktin.type == SSH2_MSG_CHANNEL_WINDOW_ADJUST) {
|
||||||
|
Loading…
Reference in New Issue
Block a user