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.
This commit is contained in:
Omar Polo 2021-10-13 20:49:58 +00:00
parent 8af884dff4
commit c62a411f4f
1 changed files with 2 additions and 1 deletions

View File

@ -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));
}