]> 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 10:29:29 +0000 (10:29 +0000)
committerFrancis Dupont <fdupont@isc.org>
Thu, 24 Jul 2008 10:29:29 +0000 (10:29 +0000)
CHANGES
lib/isc/unix/socket.c
lib/isc/win32/socket.c

diff --git a/CHANGES b/CHANGES
index 8ab8b3a1b2232ed92960320c7017053e526c8129..23781a1ef54a5c339bdd9bf5f8459179f7ca8e6f 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]
+
 2399.  [bug]           Abort timeout queries to reduce the number of open
                        UDP sockets. [RT #18367]
 
index 21ad07bd4dd17d2034bc35e27972ad8125db78cc..4e3ff3f2fa0ace7f68baae3b9dffb22ead4961ad 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.c,v 1.237.18.29.10.4 2008/07/23 23:16:44 marka Exp $ */
+/* $Id: socket.c,v 1.237.18.29.10.5 2008/07/24 10:29:28 fdupont Exp $ */
 
 /*! \file */
 
@@ -1974,7 +1974,7 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
                (void)close(fd);
                errno = tmp;
                fd = new;
-               err = "fcntl";
+               err = "accept/fcntl";
        }
 #endif
 
@@ -1982,8 +1982,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 f4ef3c5052f22c16e1b4d3acfeef686787c2cc95..20287c23b67fddc86bbe728689b559f0381e106e 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.c,v 1.30.18.20.12.4 2008/07/23 23:16:44 marka Exp $ */
+/* $Id: socket.c,v 1.30.18.20.12.5 2008/07/24 10:29:29 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
@@ -2222,7 +2222,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));