aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-05-01 03:06:34 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-07-20 23:52:54 +0200
commitf75ff13b31d546b4bceea07ce0008bf0fc5ecf71 (patch)
tree6739cd2d8202ad5710686eee2f96755a36f9c0ef /http.c
parent0b6f28d96a6ba90a88f6ffdc712a95ff49122fcf (diff)
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.
Diffstat (limited to 'http.c')
-rw-r--r--http.c2
1 files changed, 2 insertions, 0 deletions
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;