summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-02 01:23:23 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-02 01:23:23 +0000
commit1a38560be2b0203086e7f62b2235e206e43f5f91 (patch)
treeb1478582cafdbf86ae83862be0f1bba1514df8c0
parent869f115d7f427847ab85b7738905aa3bcccd57d2 (diff)
Better fix to crash jamie experienced. epoll was the only socket engine affected by this, and only under weird circumstances like a zlined user. Previous commit will work fine, this is nicer, and more complete.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5385 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/socketengine_epoll.cpp2
-rw-r--r--src/users.cpp22
2 files changed, 10 insertions, 14 deletions
diff --git a/src/socketengine_epoll.cpp b/src/socketengine_epoll.cpp
index 163bd45c6..89be6cc41 100644
--- a/src/socketengine_epoll.cpp
+++ b/src/socketengine_epoll.cpp
@@ -87,7 +87,7 @@ bool EPollEngine::DelFd(EventHandler* eh)
struct epoll_event ev;
memset(&ev,0,sizeof(struct epoll_event));
- ref[fd]->Readable() ? ev.events = EPOLLIN : ev.events = EPOLLOUT;
+ eh->Readable() ? ev.events = EPOLLIN : ev.events = EPOLLOUT;
ev.data.fd = fd;
int i = epoll_ctl(EngineHandle, EPOLL_CTL_DEL, fd, &ev);
if (i < 0)
diff --git a/src/users.cpp b/src/users.cpp
index 72b2d79a5..e80a476f3 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -957,19 +957,6 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
return;
}
- /*
- * XXX really really fixme! QuitUser doesn't like having a null entry in the ref table it seems, moving this up so
- * zlines dont crash ircd. we need a better solution, as this is obviously inefficient (and probably wrong) -- w00t
- */
- if (socket > -1)
- {
- if (!Instance->SE->AddFd(New))
- {
- userrec::QuitUser(Instance, New, "Internal error handling connection");
- return;
- }
- }
-
ELine* e = Instance->XLines->matches_exception(New);
if (!e)
{
@@ -983,6 +970,15 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
}
}
+ if (socket > -1)
+ {
+ if (!Instance->SE->AddFd(New))
+ {
+ userrec::QuitUser(Instance, New, "Internal error handling connection");
+ return;
+ }
+ }
+
New->WriteServ("NOTICE Auth :*** Looking up your hostname...");
}