1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-13 17:17:37 -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:
Simon Tatham
2001-01-29 14:30:59 +00:00
parent 6017418fca
commit 362d3deaf1
4 changed files with 12 additions and 11 deletions

5
raw.c
View File

@ -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;