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

diff --git a/CHANGES b/CHANGES
index 4dfc0d516376d785719513a6cd8149f3ff1d93c9..9aa70a80c7648d0d3a22fda637987b8fb08ce170 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 29ab14d8eb1cc1791a66dca7159cdcdba8a14e70..cb750141b1253d559cc4165822af333013583eaf 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.c,v 1.207.2.19.2.35.4.4 2008/07/23 23:47:49 tbox Exp $ */
+/* $Id: socket.c,v 1.207.2.19.2.35.4.5 2008/07/24 10:35:48 fdupont Exp $ */
 
 #include <config.h>
 
@@ -1939,7 +1939,7 @@ internal_accept(isc_task_t *me, isc_event_t *ev) {
                (void)close(fd);
                errno = tmp;
                fd = new;
-               err = "fcntl";
+               err = "accept/fcntl";
        }
 #endif
 
@@ -1947,8 +1947,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 7c883f413dff2594a5c42cb92072bd1fe9159678..a037e2ecbcf369dd2d8c6c44e272e3f3de4429cf 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.c,v 1.5.2.13.2.24.4.5 2008/07/23 23:47:49 tbox Exp $ */
+/* $Id: socket.c,v 1.5.2.13.2.24.4.6 2008/07/24 10:35:48 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
@@ -2193,7 +2193,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));