1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 #include "configreader.h"
23 #include "socketengine.h"
24 #include "inspircd_se_config.h"
27 #include "command_parse.h"
30 using irc::sockets::NonBlocking;
31 using irc::sockets::Blocking;
32 using irc::sockets::insp_ntoa;
33 using irc::sockets::insp_inaddr;
34 using irc::sockets::insp_sockaddr;
38 void InspIRCd::AddServerName(const std::string &servername)
40 this->Log(DEBUG,"Adding server name: %s",servername.c_str());
42 if(find(servernames.begin(), servernames.end(), servername) == servernames.end())
43 servernames.push_back(servername); /* Wasn't already there. */
46 const char* InspIRCd::FindServerNamePtr(const std::string &servername)
48 servernamelist::iterator iter = find(servernames.begin(), servernames.end(), servername);
50 if(iter == servernames.end())
52 AddServerName(servername);
53 iter = --servernames.end();
59 bool InspIRCd::FindServerName(const std::string &servername)
61 return (find(servernames.begin(), servernames.end(), servername) != servernames.end());
64 void InspIRCd::Exit(int status)
69 void InspIRCd::Restart(const std::string &reason)
71 this->SendError(reason);
72 std::string me = Config->MyDir + "/inspircd";
73 this->Logger->Close();
74 if (execv(me.c_str(), Config->argv) == -1)
76 /* Will raise a SIGABRT if not trapped */
77 throw CoreException(std::string("Failed to execv()! error: ") + strerror(errno));
81 void InspIRCd::Start()
83 printf("\033[1;32mInspire Internet Relay Chat Server, compiled %s at %s\n",__DATE__,__TIME__);
84 printf("(C) InspIRCd Development Team.\033[0m\n\n");
85 printf("Developers:\t\t\033[1;32mBrain, FrostyCoolSlug, w00t, Om, Special, pippijn, peavey\033[0m\n");
86 printf("Others:\t\t\t\033[1;32mSee /INFO Output\033[0m\n");
89 void InspIRCd::Rehash(int status)
91 SI->WriteOpers("Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(CONFIG_FILE));
92 fclose(SI->Config->log_file);
94 SI->Config->Read(false,NULL);
95 FOREACH_MOD_I(SI,I_OnRehash,OnRehash(""));
98 void InspIRCd::SetSignals()
100 signal(SIGALRM, SIG_IGN);
101 signal(SIGHUP, InspIRCd::Rehash);
102 signal(SIGPIPE, SIG_IGN);
103 signal(SIGTERM, InspIRCd::Exit);
104 signal(SIGCHLD, SIG_IGN);
107 bool InspIRCd::DaemonSeed()
110 if ((childpid = fork ()) < 0)
112 else if (childpid > 0)
114 /* We wait here for the child process to kill us,
115 * so that the shell prompt doesnt come back over
117 * Sending a kill with a signal of 0 just checks
118 * if the child pid is still around. If theyre not,
119 * they threw an error and we should give up.
121 while (kill(childpid, 0) != -1)
127 printf("InspIRCd Process ID: \033[1;32m%lu\033[0m\n",(unsigned long)getpid());
130 if (getrlimit(RLIMIT_CORE, &rl) == -1)
132 this->Log(DEFAULT,"Failed to getrlimit()!");
137 rl.rlim_cur = rl.rlim_max;
138 if (setrlimit(RLIMIT_CORE, &rl) == -1)
139 this->Log(DEFAULT,"setrlimit() failed, cannot increase coredump size.");
145 void InspIRCd::WritePID(const std::string &filename)
147 std::string fname = (filename.empty() ? "inspircd.pid" : filename);
148 if (*(fname.begin()) != '/')
150 std::string::size_type pos;
151 std::string confpath = CONFIG_FILE;
152 if ((pos = confpath.find("/inspircd.conf")) != std::string::npos)
154 /* Leaves us with just the path */
155 fname = confpath.substr(0, pos) + std::string("/") + fname;
158 std::ofstream outfile(fname.c_str());
159 if (outfile.is_open())
166 printf("Failed to write PID-file '%s', exiting.\n",fname.c_str());
167 this->Log(DEFAULT,"Failed to write PID-file '%s', exiting.",fname.c_str());
172 std::string InspIRCd::GetRevision()
177 InspIRCd::InspIRCd(int argc, char** argv)
178 : ModCount(-1), duration_m(60), duration_h(60*60), duration_d(60*60*24), duration_w(60*60*24*7), duration_y(60*60*24*365)
186 this->Config = new ServerConfig(this);
187 this->Config->opertypes.clear();
188 this->Config->operclass.clear();
189 this->SNO = new SnomaskManager(this);
191 this->TIME = this->OLDTIME = this->startup_time = time(NULL);
192 this->time_delta = 0;
193 this->next_call = this->TIME + 3;
195 this->Log(DEBUG,"*** InspIRCd starting up!");
196 if (!ServerConfig::FileExists(CONFIG_FILE))
198 printf("ERROR: Cannot open config file: %s\nExiting...\n",CONFIG_FILE);
199 this->Log(DEFAULT,"main: no config");
200 printf("ERROR: Your config file is missing, this IRCd will self destruct in 10 seconds!\n");
203 *this->LogFileName = 0;
205 for (int i = 1; i < argc; i++)
207 if (!strcmp(argv[i],"-nofork"))
209 Config->nofork = true;
211 else if(!strcmp(argv[i],"-debug"))
213 Config->forcedebug = true;
215 else if(!strcmp(argv[i],"-nolog"))
217 Config->writelog = false;
219 else if (!strcmp(argv[i],"-wait"))
223 else if (!strcmp(argv[i],"-logfile"))
227 strlcpy(LogFileName,argv[i+1],MAXBUF);
228 printf("LOG: Setting logfile to %s\n",LogFileName);
232 printf("ERROR: The -logfile parameter must be followed by a log file name and path.\n");
239 printf("Usage: %s [-nofork] [-nolog] [-debug] [-wait] [-logfile <filename>]\n",argv[0]);
245 strlcpy(Config->MyExecutable,argv[0],MAXBUF);
247 this->OpenLog(argv, argc);
248 this->stats = new serverstats();
249 this->Parser = new CommandParser(this);
250 this->Timers = new TimerManager();
251 this->XLines = new XLineManager(this);
252 Config->ClearStack();
253 Config->Read(true, NULL);
255 this->Modes = new ModeParser(this);
256 this->AddServerName(Config->ServerName);
258 InitializeDisabledCommands(Config->DisabledCommands, this);
259 stats->BoundPortCount = BindPorts(true, found_ports, pl);
261 for(int t = 0; t < 255; t++)
262 Config->global_implementation[t] = 0;
264 memset(&Config->implement_lists,0,sizeof(Config->implement_lists));
270 if (!this->DaemonSeed())
272 printf("ERROR: could not go into daemon mode. Shutting down.\n");
277 /* Because of limitations in kqueue on freebsd, we must fork BEFORE we
278 * initialize the socket engine.
280 SocketEngineFactory* SEF = new SocketEngineFactory();
281 SE = SEF->Create(this);
284 this->Res = new DNS(this);
286 this->LoadAllModules();
287 /* Just in case no modules were loaded - fix for bug #101 */
288 this->BuildISupport();
290 if ((stats->BoundPortCount == 0) && (found_ports > 0))
292 printf("\nERROR: I couldn't bind any ports! Are you sure you didn't start InspIRCd twice?\n");
296 if (stats->BoundPortCount != (unsigned int)found_ports)
298 printf("\nWARNING: Not all your client ports could be bound --\nstarting anyway with %ld of %d client ports bound.\n\n", stats->BoundPortCount, found_ports);
299 printf("The following port%s failed to bind:\n", found_ports - stats->BoundPortCount != 1 ? "s" : "");
301 for (FailedPortList::iterator i = pl.begin(); i != pl.end(); i++, j++)
303 printf("%d.\tIP: %s\tPort: %lu\n", j, i->first.empty() ? "<all>" : i->first.c_str(), (unsigned long)i->second);
307 /* Add the listening sockets used for client inbound connections
308 * to the socket engine
310 this->Log(DEBUG,"%d listeners",stats->BoundPortCount);
311 for (unsigned long count = 0; count < stats->BoundPortCount; count++)
313 this->Log(DEBUG,"Add listener: %d",Config->openSockfd[count]->GetFd());
314 if (!SE->AddFd(Config->openSockfd[count]))
316 printf("\nEH? Could not add listener to socketengine. You screwed up, aborting.\n");
323 if (kill(getppid(), SIGTERM) == -1)
324 printf("Error killing parent process: %s\n",strerror(errno));
330 printf("\nInspIRCd is now running!\n");
332 this->WritePID(Config->PID);
335 std::string InspIRCd::GetVersionString()
337 char versiondata[MAXBUF];
338 char dnsengine[] = "singlethread-object";
339 if (*Config->CustomVersion)
341 snprintf(versiondata,MAXBUF,"%s %s :%s",VERSION,Config->ServerName,Config->CustomVersion);
345 snprintf(versiondata,MAXBUF,"%s %s :%s [FLAGS=%lu,%s,%s]",VERSION,Config->ServerName,SYSTEM,(unsigned long)OPTIMISATION,SE->GetName().c_str(),dnsengine);
350 char* InspIRCd::ModuleError()
355 void InspIRCd::EraseFactory(int j)
358 for (std::vector<ircd_module*>::iterator t = factory.begin(); t != factory.end(); t++)
364 factory.push_back(NULL);
371 void InspIRCd::EraseModule(int j)
374 for (ModuleList::iterator m = modules.begin(); m!= modules.end(); m++)
380 modules.push_back(NULL);
386 for (std::vector<std::string>::iterator v = Config->module_names.begin(); v != Config->module_names.end(); v++)
390 Config->module_names.erase(v);
398 void InspIRCd::MoveTo(std::string modulename,int slot)
400 unsigned int v2 = 256;
401 for (unsigned int v = 0; v < Config->module_names.size(); v++)
403 if (Config->module_names[v] == modulename)
405 // found an instance, swap it with the item at the end
410 if ((v2 != (unsigned int)slot) && (v2 < 256))
412 // Swap the module names over
413 Config->module_names[v2] = Config->module_names[slot];
414 Config->module_names[slot] = modulename;
415 // now swap the module factories
416 ircd_module* temp = factory[v2];
417 factory[v2] = factory[slot];
418 factory[slot] = temp;
419 // now swap the module objects
420 Module* temp_module = modules[v2];
421 modules[v2] = modules[slot];
422 modules[slot] = temp_module;
423 // now swap the implement lists (we dont
424 // need to swap the global or recount it)
425 for (int n = 0; n < 255; n++)
427 char x = Config->implement_lists[v2][n];
428 Config->implement_lists[v2][n] = Config->implement_lists[slot][n];
429 Config->implement_lists[slot][n] = x;
434 this->Log(DEBUG,"Move of %s to slot failed!",modulename.c_str());
438 void InspIRCd::MoveAfter(std::string modulename, std::string after)
440 for (unsigned int v = 0; v < Config->module_names.size(); v++)
442 if (Config->module_names[v] == after)
444 MoveTo(modulename, v);
450 void InspIRCd::MoveBefore(std::string modulename, std::string before)
452 for (unsigned int v = 0; v < Config->module_names.size(); v++)
454 if (Config->module_names[v] == before)
458 MoveTo(modulename, v-1);
462 MoveTo(modulename, v);
469 void InspIRCd::MoveToFirst(std::string modulename)
471 MoveTo(modulename,0);
474 void InspIRCd::MoveToLast(std::string modulename)
476 MoveTo(modulename,this->GetModuleCount());
479 void InspIRCd::BuildISupport()
481 // the neatest way to construct the initial 005 numeric, considering the number of configure constants to go in it...
483 v << "WALLCHOPS WALLVOICES MODES=" << MAXMODES << " CHANTYPES=# PREFIX=" << this->Modes->BuildPrefixes() << " MAP MAXCHANNELS=" << MAXCHANS << " MAXBANS=60 VBANLIST NICKLEN=" << NICKMAX-1;
484 v << " CASEMAPPING=rfc1459 STATUSMSG=@%+ CHARSET=ascii TOPICLEN=" << MAXTOPIC << " KICKLEN=" << MAXKICK << " MAXTARGETS=" << Config->MaxTargets << " AWAYLEN=";
485 v << MAXAWAY << " CHANMODES=" << this->Modes->ChanModes() << " FNC NETWORK=" << Config->Network << " MAXPARA=32";
486 Config->data005 = v.str();
487 FOREACH_MOD_I(this,I_On005Numeric,On005Numeric(Config->data005));
491 bool InspIRCd::UnloadModule(const char* filename)
493 std::string filename_str = filename;
494 for (unsigned int j = 0; j != Config->module_names.size(); j++)
496 if (Config->module_names[j] == filename_str)
498 if (modules[j]->GetVersion().Flags & VF_STATIC)
500 this->Log(DEFAULT,"Failed to unload STATIC module %s",filename);
501 snprintf(MODERR,MAXBUF,"Module not unloadable (marked static)");
504 std::pair<int,std::string> intercount = GetInterfaceInstanceCount(modules[j]);
505 if (intercount.first > 0)
507 this->Log(DEFAULT,"Failed to unload module %s, being used by %d other(s) via interface '%s'",filename, intercount.first, intercount.second.c_str());
508 snprintf(MODERR,MAXBUF,"Module not unloadable (Still in use by %d other module%s which %s using its interface '%s') -- unload dependent modules first!",
510 intercount.first > 1 ? "s" : "",
511 intercount.first > 1 ? "are" : "is",
512 intercount.second.c_str());
515 /* Give the module a chance to tidy out all its metadata */
516 for (chan_hash::iterator c = this->chanlist.begin(); c != this->chanlist.end(); c++)
518 modules[j]->OnCleanup(TYPE_CHANNEL,c->second);
520 for (user_hash::iterator u = this->clientlist.begin(); u != this->clientlist.end(); u++)
522 modules[j]->OnCleanup(TYPE_USER,u->second);
525 /* Tidy up any dangling resolvers */
526 this->Res->CleanResolvers(modules[j]);
528 FOREACH_MOD_I(this,I_OnUnloadModule,OnUnloadModule(modules[j],Config->module_names[j]));
530 for(int t = 0; t < 255; t++)
532 Config->global_implementation[t] -= Config->implement_lists[j][t];
535 /* We have to renumber implement_lists after unload because the module numbers change!
537 for(int j2 = j; j2 < 254; j2++)
539 for(int t = 0; t < 255; t++)
541 Config->implement_lists[j2][t] = Config->implement_lists[j2+1][t];
546 this->Log(DEBUG,"Removing dependent commands...");
547 Parser->RemoveCommands(filename);
548 this->Log(DEBUG,"Deleting module...");
549 this->EraseModule(j);
550 this->Log(DEBUG,"Erasing module entry...");
551 this->EraseFactory(j);
552 this->Log(DEFAULT,"Module %s unloaded",filename);
558 this->Log(DEFAULT,"Module %s is not loaded, cannot unload it!",filename);
559 snprintf(MODERR,MAXBUF,"Module not loaded");
563 bool InspIRCd::LoadModule(const char* filename)
565 /* Do we have a glob pattern in the filename?
566 * The user wants to load multiple modules which
569 if (strchr(filename,'*') || (strchr(filename,'?')))
572 DIR* library = opendir(Config->ModPath);
575 /* Try and locate and load all modules matching the pattern */
576 dirent* entry = NULL;
577 while ((entry = readdir(library)))
579 if (this->MatchText(entry->d_name, filename))
581 if (!this->LoadModule(entry->d_name))
587 /* Loadmodule will now return false if any one of the modules failed
588 * to load (but wont abort when it encounters a bad one) and when 1 or
589 * more modules were actually loaded.
591 return (n_match > 0);
594 char modfile[MAXBUF];
595 snprintf(modfile,MAXBUF,"%s/%s",Config->ModPath,filename);
596 std::string filename_str = filename;
598 if (!ServerConfig::DirValid(modfile))
600 this->Log(DEFAULT,"Module %s is not within the modules directory.",modfile);
601 snprintf(MODERR,MAXBUF,"Module %s is not within the modules directory.",modfile);
604 this->Log(DEBUG,"Loading module: %s",modfile);
606 if (ServerConfig::FileExists(modfile))
609 for (unsigned int j = 0; j < Config->module_names.size(); j++)
611 if (Config->module_names[j] == filename_str)
613 this->Log(DEFAULT,"Module %s is already loaded, cannot load a module twice!",modfile);
614 snprintf(MODERR,MAXBUF,"Module already loaded");
620 ircd_module* a = new ircd_module(this, modfile);
621 factory[this->ModCount+1] = a;
622 if (factory[this->ModCount+1]->LastError())
624 this->Log(DEFAULT,"Unable to load %s: %s",modfile,factory[this->ModCount+1]->LastError());
625 snprintf(MODERR,MAXBUF,"Loader/Linker error: %s",factory[this->ModCount+1]->LastError());
628 if ((long)factory[this->ModCount+1]->factory != -1)
630 Module* m = factory[this->ModCount+1]->factory->CreateModule(this);
632 Version v = m->GetVersion();
634 if (v.API != API_VERSION)
638 this->Log(DEFAULT,"Unable to load %s: Incorrect module API version: %d (our version: %d)",modfile,v.API,API_VERSION);
639 snprintf(MODERR,MAXBUF,"Loader/Linker error: Incorrect module API version: %d (our version: %d)",v.API,API_VERSION);
644 this->Log(DEFAULT,"New module introduced: %s (API version %d, Module version %d.%d.%d.%d)%s", filename, v.API, v.Major, v.Minor, v.Revision, v.Build, (!(v.Flags & VF_VENDOR) ? " [3rd Party]" : " [Vendor]"));
647 modules[this->ModCount+1] = m;
648 /* save the module and the module's classfactory, if
649 * this isnt done, random crashes can occur :/ */
650 Config->module_names.push_back(filename);
652 char* x = &Config->implement_lists[this->ModCount+1][0];
653 for(int t = 0; t < 255; t++)
656 modules[this->ModCount+1]->Implements(x);
658 for(int t = 0; t < 255; t++)
659 Config->global_implementation[t] += Config->implement_lists[this->ModCount+1][t];
663 this->Log(DEFAULT,"Unable to load %s",modfile);
664 snprintf(MODERR,MAXBUF,"Factory function failed: Probably missing init_module() entrypoint.");
668 catch (CoreException& modexcept)
670 this->Log(DEFAULT,"Unable to load %s: ",modfile,modexcept.GetReason());
671 snprintf(MODERR,MAXBUF,"Factory function of %s threw an exception: %s", modexcept.GetSource(), modexcept.GetReason());
677 this->Log(DEFAULT,"InspIRCd: startup: Module Not Found %s",modfile);
678 snprintf(MODERR,MAXBUF,"Module file could not be found");
682 FOREACH_MOD_I(this,I_OnLoadModule,OnLoadModule(modules[this->ModCount],filename_str));
683 // now work out which modules, if any, want to move to the back of the queue,
684 // and if they do, move them there.
685 std::vector<std::string> put_to_back;
686 std::vector<std::string> put_to_front;
687 std::map<std::string,std::string> put_before;
688 std::map<std::string,std::string> put_after;
689 for (unsigned int j = 0; j < Config->module_names.size(); j++)
691 if (modules[j]->Prioritize() == PRIORITY_LAST)
692 put_to_back.push_back(Config->module_names[j]);
693 else if (modules[j]->Prioritize() == PRIORITY_FIRST)
694 put_to_front.push_back(Config->module_names[j]);
695 else if ((modules[j]->Prioritize() & 0xFF) == PRIORITY_BEFORE)
696 put_before[Config->module_names[j]] = Config->module_names[modules[j]->Prioritize() >> 8];
697 else if ((modules[j]->Prioritize() & 0xFF) == PRIORITY_AFTER)
698 put_after[Config->module_names[j]] = Config->module_names[modules[j]->Prioritize() >> 8];
700 for (unsigned int j = 0; j < put_to_back.size(); j++)
701 MoveToLast(put_to_back[j]);
702 for (unsigned int j = 0; j < put_to_front.size(); j++)
703 MoveToFirst(put_to_front[j]);
704 for (std::map<std::string,std::string>::iterator j = put_before.begin(); j != put_before.end(); j++)
705 MoveBefore(j->first,j->second);
706 for (std::map<std::string,std::string>::iterator j = put_after.begin(); j != put_after.end(); j++)
707 MoveAfter(j->first,j->second);
712 void InspIRCd::DoOneIteration(bool process_module_sockets)
716 /* time() seems to be a pretty expensive syscall, so avoid calling it too much.
717 * Once per loop iteration is pleanty.
722 /* Run background module timers every few seconds
723 * (the docs say modules shouldnt rely on accurate
724 * timing using this event, so we dont have to
725 * time this exactly).
730 WriteOpers("*** \002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",abs(OLDTIME-TIME));
731 if ((TIME % 3600) == 0)
733 irc::whowas::MaintainWhoWas(this, TIME);
735 Timers->TickTimers(TIME);
736 this->DoBackgroundUserStuff(TIME);
740 XLines->expire_lines();
741 FOREACH_MOD_I(this,I_OnBackgroundTimer,OnBackgroundTimer(TIME));
742 Timers->TickMissedTimers(TIME);
745 if (!getrusage(0, &ru))
747 gettimeofday(&this->stats->LastSampled, NULL);
748 this->stats->LastCPU = ru.ru_utime;
752 /* Call the socket engine to wait on the active
753 * file descriptors. The socket engine has everything's
754 * descriptors in its list... dns, modules, users,
755 * servers... so its nice and easy, just one call.
756 * This will cause any read or write events to be
757 * dispatched to their handlers.
759 SE->DispatchEvents();
762 bool InspIRCd::IsIdent(const char* n)
767 for (char* i = (char*)n; *i; i++)
769 if ((*i >= 'A') && (*i <= '}'))
773 if (((*i >= '0') && (*i <= '9')) || (*i == '-') || (*i == '.'))
787 DoOneIteration(true);
789 /* This is never reached -- we hope! */
793 /**********************************************************************************/
796 * An ircd in four lines! bwahahaha. ahahahahaha. ahahah *cough*.
799 int main(int argc, char** argv)
801 SI = new InspIRCd(argc, argv);
807 /* this returns true when all modules are satisfied that the user should be allowed onto the irc server
808 * (until this returns true, a user will block in the waiting state, waiting to connect up to the
809 * registration timeout maximum seconds)
811 bool InspIRCd::AllModulesReportReady(userrec* user)
813 if (!Config->global_implementation[I_OnCheckReady])
816 for (int i = 0; i <= this->GetModuleCount(); i++)
818 if (Config->implement_lists[i][I_OnCheckReady])
820 int res = modules[i]->OnCheckReady(user);
828 int InspIRCd::GetModuleCount()
830 return this->ModCount;
833 time_t InspIRCd::Time(bool delta)
836 return TIME + time_delta;
840 int InspIRCd::SetTimeDelta(int delta)
842 int old = time_delta;
844 this->Log(DEBUG, "Time delta set to %d (was %d)", time_delta, old);
848 void InspIRCd::AddLocalClone(userrec* user)
850 clonemap::iterator x = local_clones.find(user->GetIPString());
851 if (x != local_clones.end())
854 local_clones[user->GetIPString()] = 1;
857 void InspIRCd::AddGlobalClone(userrec* user)
859 clonemap::iterator y = global_clones.find(user->GetIPString());
860 if (y != global_clones.end())
863 global_clones[user->GetIPString()] = 1;
866 int InspIRCd::GetTimeDelta()
871 bool FileLogger::Readable()
876 void FileLogger::HandleEvent(EventType et, int errornum)
878 this->WriteLogLine("");
879 ServerInstance->SE->DelFd(this);
882 void FileLogger::WriteLogLine(const std::string &line)
889 int written = fprintf(log,"%s",buffer.c_str());
890 if ((written >= 0) && (written < (int)buffer.length()))
892 buffer.erase(0, buffer.length());
893 ServerInstance->SE->AddFd(this);
895 else if (written == -1)
898 ServerInstance->SE->AddFd(this);
902 /* Wrote the whole buffer, and no need for write callback */
912 void FileLogger::Close()
916 int flags = fcntl(fileno(log), F_GETFL, 0);
917 fcntl(fileno(log), F_SETFL, flags ^ O_NONBLOCK);
919 fprintf(log,"%s",buffer.c_str());
924 ServerInstance->SE->DelFd(this);
927 FileLogger::FileLogger(InspIRCd* Instance, FILE* logfile) : ServerInstance(Instance), log(logfile), writeops(0)
929 irc::sockets::NonBlocking(fileno(log));
930 this->SetFd(fileno(log));
934 FileLogger::~FileLogger()