summaryrefslogtreecommitdiff
path: root/src/socketengine.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-02-08 22:34:11 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-02-08 22:34:11 +0100
commitaea38a0dd702895b7dfd18efd26a0dcead2279fc (patch)
tree471443cdc87a922131a7cbf14c313d46b946ee5d /src/socketengine.cpp
parentb01820c079a605654d6307f6e57d65b339deef7d (diff)
Update SocketEngine::CurrentSetSize in AddFdRef()/DelFdRef()
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r--src/socketengine.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp
index c5f8031b5..35fe5292f 100644
--- a/src/socketengine.cpp
+++ b/src/socketengine.cpp
@@ -39,6 +39,7 @@ SocketEngine::SocketEngine()
TotalEvents = WriteEvents = ReadEvents = ErrorEvents = 0;
lastempty = ServerInstance->Time();
indata = outdata = 0;
+ CurrentSetSize = 0;
}
SocketEngine::~SocketEngine()
@@ -103,6 +104,7 @@ bool SocketEngine::AddFdRef(EventHandler* eh)
while (static_cast<unsigned int>(fd) >= ref.size())
ref.resize(ref.empty() ? 1 : (ref.size() * 2));
ref[fd] = eh;
+ CurrentSetSize++;
return true;
}
@@ -110,7 +112,10 @@ void SocketEngine::DelFdRef(EventHandler *eh)
{
int fd = eh->GetFd();
if (GetRef(fd) == eh)
+ {
ref[fd] = NULL;
+ CurrentSetSize--;
+ }
}
bool SocketEngine::HasFd(int fd)