mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-12 18:13:50 -05:00
Prevent duplicate sk_close() calls on the same socket when the
connection dies unexpectedly (CONNABORTED / CONNRESET) [originally from svn r910]
This commit is contained in:
parent
6017418fca
commit
362d3deaf1
5
raw.c
5
raw.c
@ -27,11 +27,12 @@ static void c_write (char *buf, int len) {
|
||||
static int raw_receive (Socket skt, int urgent, char *data, int len) {
|
||||
if (urgent==3) {
|
||||
/* A socket error has occurred. */
|
||||
sk_close(s);
|
||||
s = NULL;
|
||||
connection_fatal(data);
|
||||
len = 0;
|
||||
}
|
||||
if (!len) {
|
||||
return 0;
|
||||
} else if (!len) {
|
||||
/* Connection has closed. */
|
||||
sk_close(s);
|
||||
s = NULL;
|
||||
|
6
rlogin.c
6
rlogin.c
@ -27,11 +27,11 @@ static void c_write (char *buf, int len) {
|
||||
static int rlogin_receive (Socket skt, int urgent, char *data, int len) {
|
||||
if (urgent==3) {
|
||||
/* A socket error has occurred. */
|
||||
sk_close(s);
|
||||
s = NULL;
|
||||
connection_fatal(data);
|
||||
len = 0;
|
||||
}
|
||||
if (!len) {
|
||||
return 0;
|
||||
} else if (!len) {
|
||||
/* Connection has closed. */
|
||||
sk_close(s);
|
||||
s = NULL;
|
||||
|
6
ssh.c
6
ssh.c
@ -1153,11 +1153,11 @@ static int ssh_receive(Socket skt, int urgent, char *data, int len) {
|
||||
if (urgent==3) {
|
||||
/* A socket error has occurred. */
|
||||
ssh_state = SSH_STATE_CLOSED;
|
||||
sk_close(s);
|
||||
s = NULL;
|
||||
connection_fatal(data);
|
||||
len = 0;
|
||||
}
|
||||
if (!len) {
|
||||
return 0;
|
||||
} else if (!len) {
|
||||
/* Connection has closed. */
|
||||
ssh_state = SSH_STATE_CLOSED;
|
||||
sk_close(s);
|
||||
|
6
telnet.c
6
telnet.c
@ -468,11 +468,11 @@ static void do_telnet_read (char *buf, int len) {
|
||||
static int telnet_receive(Socket skt, int urgent, char *data, int len) {
|
||||
if (urgent==3) {
|
||||
/* A socket error has occurred. */
|
||||
sk_close(s);
|
||||
s = NULL;
|
||||
connection_fatal(data);
|
||||
len = 0;
|
||||
}
|
||||
if (!len) {
|
||||
return 0;
|
||||
} else if (!len) {
|
||||
/* Connection has closed. */
|
||||
sk_close(s);
|
||||
s = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user