diff options
-rw-r--r-- | src/socketengine_epoll.cpp | 5 | ||||
-rw-r--r-- | src/socketengine_iocp.cpp | 5 | ||||
-rw-r--r-- | src/socketengine_kqueue.cpp | 2 | ||||
-rw-r--r-- | src/socketengine_ports.cpp | 2 | ||||
-rw-r--r-- | src/socketengine_select.cpp | 2 |
5 files changed, 5 insertions, 11 deletions
diff --git a/src/socketengine_epoll.cpp b/src/socketengine_epoll.cpp index 55d3cb1ea..df79aa083 100644 --- a/src/socketengine_epoll.cpp +++ b/src/socketengine_epoll.cpp @@ -49,10 +49,7 @@ bool EPollEngine::AddFd(EventHandler* eh) return false; if (ref[fd]) - { - ServerInstance->Log(DEBUG,"Ref occupied!"); - return false; - } + DelFd(ref[fd]); struct epoll_event ev; memset(&ev,0,sizeof(struct epoll_event)); diff --git a/src/socketengine_iocp.cpp b/src/socketengine_iocp.cpp index 155fb14f4..d780b9043 100644 --- a/src/socketengine_iocp.cpp +++ b/src/socketengine_iocp.cpp @@ -58,10 +58,7 @@ bool IOCPEngine::AddFd(EventHandler* eh) /* Already an entry here */ if (ref[*fake_fd]) - { - delete fake_fd; - return false; - } + DelFd(ref[fd]); /* are we a listen socket? */ getsockopt(eh->GetFd(), SOL_SOCKET, SO_ACCEPTCONN, (char*)&is_accept, &opt_len); diff --git a/src/socketengine_kqueue.cpp b/src/socketengine_kqueue.cpp index 640172305..0f6f805ca 100644 --- a/src/socketengine_kqueue.cpp +++ b/src/socketengine_kqueue.cpp @@ -59,7 +59,7 @@ bool KQueueEngine::AddFd(EventHandler* eh) return false; if (ref[fd]) - return false; + DelFd(ref[fd]); struct kevent ke; EV_SET(&ke, fd, eh->Readable() ? EVFILT_READ : EVFILT_WRITE, EV_ADD, 0, 0, NULL); diff --git a/src/socketengine_ports.cpp b/src/socketengine_ports.cpp index 352b73062..7ebceacc8 100644 --- a/src/socketengine_ports.cpp +++ b/src/socketengine_ports.cpp @@ -46,7 +46,7 @@ bool PortsEngine::AddFd(EventHandler* eh) return false; if (ref[fd]) - return false; + DelFd(ref[fd]); ref[fd] = eh; port_associate(EngineHandle, PORT_SOURCE_FD, fd, eh->Readable() ? POLLRDNORM : POLLWRNORM, eh); diff --git a/src/socketengine_select.cpp b/src/socketengine_select.cpp index 3cebe7210..a369cc95a 100644 --- a/src/socketengine_select.cpp +++ b/src/socketengine_select.cpp @@ -37,7 +37,7 @@ bool SelectEngine::AddFd(EventHandler* eh) return false; if (ref[fd]) - return false; + DelFd(ref[fd]); fds[fd] = fd; ref[fd] = eh; |