aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-10-13 20:49:58 +0000
committerOmar Polo <op@omarpolo.com>2021-10-13 20:49:58 +0000
commitc62a411f4f5c0a9b9ef6a1a474ee976bf5f711af (patch)
treee7f05121306a89929060d88482314a35d3ffd23a /server.c
parent8af884dff41841074cadb91516c86c9ef954fe26 (diff)
don't die on ECONNABORTED
ECONNABORTED is returned if a connections gets aborted after being queued before the accept(2). I had some cases of accept: Software caused connection abort on FreeBSD, this should avoid that.
Diffstat (limited to 'server.c')
-rw-r--r--server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/server.c b/server.c
index 2ad472c..cac53ee 100644
--- a/server.c
+++ b/server.c
@@ -1284,7 +1284,8 @@ do_accept(int sock, short et, void *d)
saddr = (struct sockaddr*)&addr;
len = sizeof(addr);
if ((fd = accept(sock, saddr, &len)) == -1) {
- if (errno == EWOULDBLOCK || errno == EAGAIN)
+ if (errno == EWOULDBLOCK || errno == EAGAIN ||
+ errno == ECONNABORTED)
return;
fatal("accept: %s", strerror(errno));
}