mirror of
https://github.com/inspircd/inspircd.git
synced 2025-04-17 21:50:03 -04:00
Optimization and removal of casts (profiling stuff)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4930 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
e0a572b920
commit
9037003b88
@ -265,16 +265,16 @@ void InspIRCd::ProcessUser(userrec* cu)
|
|||||||
void InspIRCd::DoSocketTimeouts(time_t TIME)
|
void InspIRCd::DoSocketTimeouts(time_t TIME)
|
||||||
{
|
{
|
||||||
unsigned int numsockets = this->module_sockets.size();
|
unsigned int numsockets = this->module_sockets.size();
|
||||||
SocketEngine* SE = this->SE;
|
|
||||||
|
|
||||||
for (std::vector<InspSocket*>::iterator a = this->module_sockets.begin(); a < this->module_sockets.end(); a++)
|
for (std::vector<InspSocket*>::iterator a = this->module_sockets.begin(); a < this->module_sockets.end(); a++)
|
||||||
{
|
{
|
||||||
InspSocket* s = (InspSocket*)*a;
|
InspSocket* s = *a;
|
||||||
if ((s) && (s->GetFd() >= 0) && (s->GetFd() < MAX_DESCRIPTORS) && (this->socket_ref[s->GetFd()] != NULL) && (s->Timeout(TIME)))
|
int fd = s->GetFd();
|
||||||
|
if ((s) && (fd >= 0) && (fd < MAX_DESCRIPTORS) && (this->socket_ref[fd] != NULL) && (s->Timeout(TIME)))
|
||||||
{
|
{
|
||||||
this->Log(DEBUG,"userprocess.cpp: Socket poll returned false, close and bail");
|
this->Log(DEBUG,"userprocess.cpp: Socket poll returned false, close and bail");
|
||||||
this->socket_ref[s->GetFd()] = NULL;
|
this->socket_ref[fd] = NULL;
|
||||||
SE->DelFd(s->GetFd());
|
SE->DelFd(fd);
|
||||||
this->module_sockets.erase(a);
|
this->module_sockets.erase(a);
|
||||||
s->Close();
|
s->Close();
|
||||||
DELETE(s);
|
DELETE(s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user