X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands.cpp;h=5011b7d618b784ae043247b18834d94453a3f0f5;hb=55bc98f87d824e2803141aef1632fffc6eef4496;hp=d1d28bd566ca8fb5a36b20fe8b03aeacddfa6a23;hpb=a551203100f50ff4767d516566f38277bd268110;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands.cpp b/src/commands.cpp index d1d28bd56..5011b7d61 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -14,6 +14,8 @@ * --------------------------------------------------- */ +using namespace std; + #include "inspircd.h" #include "inspircd_io.h" #include "inspircd_util.h" @@ -22,11 +24,17 @@ #include #include #include + #ifdef USE_KQUEUE #include #include #include #endif + +#ifdef USE_EPOLL +#include +#endif + #include #include #include @@ -62,15 +70,17 @@ #include "helperfuncs.h" #include "hashcomp.h" -using namespace std; - #ifdef USE_KQUEUE extern int kq; #endif +#ifdef USE_EPOLL +int ep; +#endif + extern int MODCOUNT; -extern std::vector modules; -extern std::vector factory; +extern std::vector modules; +extern std::vector factory; extern int LogLevel; extern char ServerName[MAXBUF]; @@ -100,7 +110,7 @@ extern bool nofork; extern time_t TIME; -extern std::vector module_names; +extern std::vector module_names; extern char MyExecutable[1024]; extern int boundPortCount; @@ -124,11 +134,11 @@ const long duration_d = duration_h * 24; const long duration_w = duration_d * 7; const long duration_y = duration_w * 52; -typedef nspace::hash_map, irc::StrHashComp, __single_client_alloc> user_hash; -typedef nspace::hash_map, irc::StrHashComp, __single_client_alloc> chan_hash; -typedef nspace::hash_map, irc::InAddr_HashComp, __single_client_alloc> address_cache; -typedef nspace::hash_map, irc::StrHashComp, __single_client_alloc> whowas_hash; -typedef std::deque command_table; +typedef nspace::hash_map, irc::StrHashComp> user_hash; +typedef nspace::hash_map, irc::StrHashComp> chan_hash; +typedef nspace::hash_map, irc::InAddr_HashComp> address_cache; +typedef nspace::hash_map, irc::StrHashComp> whowas_hash; +typedef std::deque command_table; extern user_hash clientlist; @@ -139,7 +149,7 @@ extern file_cache MOTD; extern file_cache RULES; extern address_cache IP; -extern std::vector all_opers; +extern std::vector all_opers; // This table references users by file descriptor. // its an array to make it VERY fast, as all lookups are referenced @@ -920,6 +930,16 @@ void handle_quit(char **parameters, int pcnt, userrec *user) { log(DEBUG,"kqueue: Failed to remove user from queue!"); } +#endif +#ifdef USE_EPOLL + struct epoll_event ev; + ev.events = EPOLLIN | EPOLLET; + ev.data.fd = user->fd; + int i = epoll_ctl(ep, EPOLL_CTL_DEL, user->fd, &ev); + if (i < 0) + { + log(DEBUG,"epoll: List deletion failure!"); + } #endif shutdown(user->fd,2); close(user->fd);