diff options
-rw-r--r-- | src/inspircd.cpp | 1 | ||||
-rw-r--r-- | src/socket.cpp | 2 | ||||
-rw-r--r-- | src/userprocess.cpp | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 22fe0ae6e..a7ce18f4a 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -704,6 +704,7 @@ void InspIRCd::DoOneIteration(bool process_module_sockets) { log(DEBUG,"Socket poll returned false, close and bail"); SE->DelFd(s->GetFd()); + socket_ref[activefds[activefd]] = NULL; for (std::vector<InspSocket*>::iterator a = module_sockets.begin(); a < module_sockets.end(); a++) { s_del = (InspSocket*)*a; diff --git a/src/socket.cpp b/src/socket.cpp index f4e6a5a6a..508d638cf 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -278,7 +278,6 @@ bool InspSocket::FlushWriteBuffer() log(DEBUG,"Write error on socket: %s",strerror(errno)); this->OnError(I_ERR_WRITE); this->state = I_ERROR; - this->fd = -1; return true; } } @@ -299,7 +298,6 @@ bool InspSocket::Timeout(time_t current) this->OnError(I_ERR_TIMEOUT); timeout = true; this->state = I_ERROR; - this->fd = -1; return true; } return this->FlushWriteBuffer(); diff --git a/src/userprocess.cpp b/src/userprocess.cpp index 104fff4ee..182cd2eb5 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -70,6 +70,7 @@ extern std::vector<InspSocket*> module_sockets; extern time_t TIME; extern time_t OLDTIME; extern std::vector<userrec*> local_users; +extern InspSocket* socket_ref[MAX_DESCRIPTORS]; char LOG_FILE[MAXBUF]; extern InspIRCd* ServerInstance; @@ -320,6 +321,7 @@ void DoSocketTimeouts(time_t TIME) { log(DEBUG,"Socket poll returned false, close and bail"); SE->DelFd(s->GetFd()); + socket_ref[s->GetFd()] = NULL; s->Close(); module_sockets.erase(a); delete s; |