diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-11 17:38:49 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-11 17:38:49 +0000 |
commit | 381412179424cac7961c31421f2768ef971783db (patch) | |
tree | 6eaec5fca4523aecca53c786307f42a046aa4286 /src | |
parent | db20c20a945e2107e1a9c66d62127c0833075ea8 (diff) |
Re-enterant safety
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3666 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-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; |