diff options
author | Omar Polo <op@omarpolo.com> | 2021-10-13 20:49:58 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-10-13 20:49:58 +0000 |
commit | c62a411f4f5c0a9b9ef6a1a474ee976bf5f711af (patch) | |
tree | e7f05121306a89929060d88482314a35d3ffd23a /server.c | |
parent | 8af884dff41841074cadb91516c86c9ef954fe26 (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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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)); } |