Expect to get E[MN]FILE errno internal_accept() [RT #18358]
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
+12
-3
@@ -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:
|
||||
|
||||
+11
-2
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user