From a3d9df87cbac7e26eb8b3fd6a4ca803198e9b072 Mon Sep 17 00:00:00 2001 From: yrutschle Date: Wed, 2 Dec 2020 22:48:17 +0100 Subject: [PATCH] fix typo and explicit a test --- common.c | 2 +- sslh-fork.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common.c b/common.c index 09e4c4e..5b90dc9 100644 --- a/common.c +++ b/common.c @@ -466,7 +466,7 @@ int fd2fd(struct queue *target_q, struct queue *from_q) case ECONNRESET: case EPIPE: - /* remove end closed -- drop the connection */ + /* remote end closed -- drop the connection */ return FD_CNXCLOSED; } } else if (size_w < size_r) { diff --git a/sslh-fork.c b/sslh-fork.c index f6e1572..d6c2d4b 100644 --- a/sslh-fork.c +++ b/sslh-fork.c @@ -58,7 +58,7 @@ int shovel(struct connection *cnx) for (i = 0; i < 2; i++) { if (FD_ISSET(cnx->q[i].fd, &fds)) { res = fd2fd(&cnx->q[1-i], &cnx->q[i]); - if (!res) { + if (res == FD_CNXCLOSED) { if (cfg.verbose) fprintf(stderr, "%s %s", i ? "client" : "server", "socket closed\n"); return res;