]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Expect to get E[MN]FILE errno internal_accept() [RT #18358]
authorFrancis Dupont <fdupont@isc.org>
Thu, 24 Jul 2008 09:50:21 +0000 (09:50 +0000)
committerFrancis Dupont <fdupont@isc.org>
Thu, 24 Jul 2008 09:50:21 +0000 (09:50 +0000)
CHANGES
lib/isc/unix/socket.c
lib/isc/win32/socket.c

diff --git a/CHANGES b/CHANGES
index cf76152bbf629eddc480465809eef83ebd104829..4ff2c5fa6c09cf8693830387ab7de7699251fbe9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2401.  [bug]           Expect to get E[MN]FILE errno internal_accept()
+                       (from accept() or fcntl() system calls). [RT #18358]
+
 2400.  [bug]           Log if kqueue()/epoll_create()/open(/dev/poll) fails.
                        [RT #18297]
 
index 33425ce809dddb6eb799bc251f28642d8e15f7a5..09582d30281a7f9ba71e0ae8072020ac0e515c68 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.c,v 1.293 2008/07/24 05:19:15 jinmei Exp $ */
+/* $Id: socket.c,v 1.294 2008/07/24 09:50:21 fdupont Exp $ */
 
 /*! \file */
 
@@ -2511,7 +2511,7 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
                (void)close(fd);
                errno = tmp;
                fd = new;
-               err = "fcntl";
+               err = "accept/fcntl";
        }
 #endif
 
@@ -2519,8 +2519,17 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
                if (SOFT_ERROR(errno))
                        goto soft_error;
                switch (errno) {
-               case ENOBUFS:
                case ENFILE:
+               case EMFILE:
+                       isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+                                      ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+                                      isc_msgcat, ISC_MSGSET_SOCKET,
+                                      ISC_MSG_TOOMANYFDS,
+                                      "%s: too many open file descriptors",
+                                      err);
+                       goto soft_error;
+
+               case ENOBUFS:
                case ENOMEM:
                case ECONNRESET:
                case ECONNABORTED:
index d8da30d7e7847cfedf26c3e7462a924f0f9112a2..ed6132eeffe6b7c2491ca1452f9ac8c1e4c4361b 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.c,v 1.61 2008/07/23 23:47:07 tbox Exp $ */
+/* $Id: socket.c,v 1.62 2008/07/24 09:50:21 fdupont Exp $ */
 
 /* This code has been rewritten to take advantage of Windows Sockets
  * I/O Completion Ports and Events. I/O Completion Ports is ONLY
@@ -2238,7 +2238,16 @@ internal_accept(isc_socket_t *sock, int accept_errno) {
                    (void *)&addrlen);
        if (fd == INVALID_SOCKET) {
                accept_errno = WSAGetLastError();
-               if (SOFT_ERROR(accept_errno) || accept_errno == WSAECONNRESET) {
+               if (accept_errno == WSAEMFILE) {
+                       isc_log_iwrite(isc_lctx, ISC_LOGCATEGORY_GENERAL,
+                                      ISC_LOGMODULE_SOCKET, ISC_LOG_ERROR,
+                                      isc_msgcat, ISC_MSGSET_SOCKET,
+                                      ISC_MSG_TOOMANYFDS,
+                                      "%s: too many open file descriptors",
+                                      "accept");
+                       goto soft_error;
+               } else if (SOFT_ERROR(accept_errno) ||
+                          accept_errno == WSAECONNRESET) {
                        goto soft_error;
                } else {
                        isc__strerror(accept_errno, strbuf, sizeof(strbuf));