summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-06-01 17:17:17 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-06-01 17:17:17 +0000
commit9759b69735a5902d2850b50336f2d7220a2746e6 (patch)
tree0de6a4e94334dc01299e74f1672d7e9dde009aca /src
parent445927aa6c755319f83fe2bcfef13661043e2b57 (diff)
Improve debug output on a few key methods of epoll socketengine, a must when coding for the socket engine.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9830 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/socketengines/socketengine_epoll.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/socketengines/socketengine_epoll.cpp b/src/socketengines/socketengine_epoll.cpp
index d3faf12a1..fa7a8e03f 100644
--- a/src/socketengines/socketengine_epoll.cpp
+++ b/src/socketengines/socketengine_epoll.cpp
@@ -50,15 +50,21 @@ bool EPollEngine::AddFd(EventHandler* eh)
int fd = eh->GetFd();
if ((fd < 0) || (fd > GetMaxFds() - 1))
{
- ServerInstance->Logs->Log("SOCKET",DEBUG,"Out of range FD: (fd: %d, max: %d)", fd, GetMaxFds());
+ ServerInstance->Logs->Log("SOCKET",DEBUG,"AddFd out of range: (fd: %d, max: %d)", fd, GetMaxFds());
return false;
}
if (GetRemainingFds() <= 1)
+ {
+ ServerInstance->Logs->Log("SOCKET",DEBUG,"No remaining FDs cannot add fd: %d", fd);
return false;
+ }
if (ref[fd])
+ {
+ ServerInstance->Logs->Log("SOCKET",DEBUG,"Attempt to add duplicate fd: %d", fd);
return false;
+ }
struct epoll_event ev;
memset(&ev,0,sizeof(struct epoll_event));
@@ -67,6 +73,7 @@ bool EPollEngine::AddFd(EventHandler* eh)
int i = epoll_ctl(EngineHandle, EPOLL_CTL_ADD, fd, &ev);
if (i < 0)
{
+ ServerInstance->Logs->Log("SOCKET",DEBUG,"Error adding fd: %d to socketengine: %s", fd, strerror(errno));
return false;
}
@@ -93,7 +100,10 @@ bool EPollEngine::DelFd(EventHandler* eh, bool force)
{
int fd = eh->GetFd();
if ((fd < 0) || (fd > GetMaxFds() - 1))
+ {
+ ServerInstance->Logs->Log("SOCKET",DEBUG,"DelFd out of range: (fd: %d, max: %d)", fd, GetMaxFds());
return false;
+ }
struct epoll_event ev;
memset(&ev,0,sizeof(struct epoll_event));