diff --git a/NEWS b/NEWS index 97e5e964..acbfc467 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ NEWS * fixed conditional server.allow-http-11 * fixed handling of follow-symlink + lstat() * fixed SIGHUP handling if max-workers is used + * fixed "Software caused connection abort" messages on FreeBSD - 1.4.11 - 2006-03-09 diff --git a/src/connections.c b/src/connections.c index fc67e59e..e8dadce1 100644 --- a/src/connections.c +++ b/src/connections.c @@ -1261,8 +1261,17 @@ connection *connection_accept(server *srv, server_socket *srv_socket) { cnt_len = sizeof(cnt_addr); if (-1 == (cnt = accept(srv_socket->fd, (struct sockaddr *) &cnt_addr, &cnt_len))) { - if ((errno != EAGAIN) && - (errno != EINTR)) { + switch (errno) { + case EAGAIN: +#if EWOULDBLOCK != EAGAIN + case EWOULDBLOCK: +#endif + case EINTR: + /* we were stopped _before_ we had a connection */ + case ECONNABORTED: /* this is a FreeBSD thingy */ + /* we were stopped _after_ we had a connection */ + break; + default: log_error_write(srv, __FILE__, __LINE__, "ssd", "accept failed:", strerror(errno), errno); } return NULL;