From 00a5770e2ffcc4fa62ff610439823b262a3ee231 Mon Sep 17 00:00:00 2001 From: Jan Kneschke Date: Sat, 16 Sep 2006 11:28:28 +0000 Subject: [PATCH] fixed "Software caused connection abort" messages on FreeBSD git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1311 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/connections.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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;