From f75ff13b31d546b4bceea07ce0008bf0fc5ecf71 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 1 May 2023 03:06:34 +0200 Subject: Avoid crashing on SIGPIPE Under some circumstances, clients could cause SIGPIPE to slcl. Since this signal was not handled by server.c (i.e., via sigaction(3)), slcl would crash without any error messages printed to stderr. In such situation, SIGPIPE should not be usually considered a fatal error, so it is preferrable to close the connection and keep working. --- http.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'http.c') diff --git a/http.c b/http.c index 501499b..d843bb5 100644 --- a/http.c +++ b/http.c @@ -496,6 +496,8 @@ static int rw_error(const int r, bool *const close) { switch (errno) { + case EPIPE: + /* Fall through. */ case ECONNRESET: *close = true; return 1; -- cgit v1.2.3