From: brain Date: Wed, 11 May 2005 01:24:59 +0000 (+0000) Subject: Fixed weird bug where on mass join/part flood, the channel would be X-Git-Tag: v2.0.23~10323 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=275d48551c78d4c8253ef6b8c40dda09baec56d6;p=user%2Fhenk%2Fcode%2Finspircd.git Fixed weird bug where on mass join/part flood, the channel would be purged before it was actually empty due to its counters being screwed up git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1360 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/src/channels.cpp b/src/channels.cpp index 6d6c15f13..4e46c3b30 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -201,20 +201,15 @@ std::string chanrec::GetModeParameter(char mode) void chanrec::IncUserCounter() { - this->users++; - log(DEBUG,"Incremented channel user count for %s to %lu",name,(unsigned long)users); } void chanrec::DecUserCounter() { - if (this->users > 0) - this->users--; - log(DEBUG,"Decremented channel user count for %s to %lu",name,(unsigned long)users); } long chanrec::GetUserCounter() { - return (this->users); + return (this->internal_userlist.size()); } void chanrec::AddUser(char* castuser) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 21e3bffd9..8da1f7bf5 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -1384,7 +1384,6 @@ void purge_empty_chans(userrec* u) { if (u->chans[f].channel) { - u->chans[f].channel->DecUserCounter(); u->chans[f].channel->DelUser((char*)u); } } @@ -1897,7 +1896,6 @@ chanrec* del_channel(userrec *user, const char* cname, const char* reason, bool } } - Ptr->DecUserCounter(); Ptr->DelUser((char*)user); /* if there are no users left on the channel */ @@ -1982,7 +1980,6 @@ void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason) } } - Ptr->DecUserCounter(); Ptr->DelUser((char*)user); /* if there are no users left on the channel */ diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index 3ef3c11e3..f1b122fa1 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -87,17 +87,13 @@ void WritePID(std::string filename) } } -void DeadPipe(int status) -{ - signal (SIGPIPE, DeadPipe); -} int DaemonSeed (void) { int childpid; signal (SIGALRM, SIG_IGN); signal (SIGHUP, Rehash); - signal (SIGPIPE, DeadPipe); + signal (SIGPIPE, SIG_IGN); signal (SIGTERM, Exit); signal (SIGSEGV, Error); if ((childpid = fork ()) < 0)