1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Miscellaneous fixes for better interoperation with commercial SSH 2

[originally from svn r708]
This commit is contained in:
Simon Tatham 2000-10-12 13:34:46 +00:00
parent e67f143e61
commit fd3e15f328
2 changed files with 7 additions and 2 deletions

View File

@ -511,6 +511,8 @@ int main(int argc, char **argv) {
back->special(TS_EOF);
}
}
if (back->socket() == INVALID_SOCKET)
break; /* we closed the connection */
}
WSACleanup();
return 0;

7
ssh.c
View File

@ -25,7 +25,7 @@
if ((flags & FLAG_STDERR) && (flags & FLAG_VERBOSE)) \
fprintf(stderr, "%s\n", s); }
#define bombout(msg) ( ssh_state == SSH_STATE_CLOSED, closesocket(s), \
#define bombout(msg) ( ssh_state = SSH_STATE_CLOSED, closesocket(s), \
s = INVALID_SOCKET, connection_fatal msg )
#define SSH1_MSG_DISCONNECT 1 /* 0x1 */
@ -2285,7 +2285,7 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
ssh2_pkt_init(SSH2_MSG_CHANNEL_OPEN);
ssh2_pkt_addstring("session");
ssh2_pkt_adduint32(mainchan->localid);
ssh2_pkt_adduint32(0x7FFFFFFFUL); /* our window size */
ssh2_pkt_adduint32(0x8000UL); /* our window size */
ssh2_pkt_adduint32(0x4000UL); /* our max pkt size */
ssh2_pkt_send();
crWaitUntilV(ispkt);
@ -2429,6 +2429,9 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
logevent("All channels closed. Disconnecting");
ssh2_pkt_init(SSH2_MSG_DISCONNECT);
ssh2_pkt_send();
ssh_state = SSH_STATE_CLOSED;
closesocket(s);
s = INVALID_SOCKET;
}
continue; /* remote sends close; ignore (FIXME) */
} else if (pktin.type == SSH2_MSG_CHANNEL_WINDOW_ADJUST) {