]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands.cpp
Added COMMANDS command (yes, really)
[user/henk/code/inspircd.git] / src / commands.cpp
index 23d285eee8281f2a5ccf9d2e7dd3d5043f7315e1..2b96b0a8ffb9f3323899fbcd8ed781c7afb85f31 100644 (file)
@@ -14,6 +14,8 @@
  * ---------------------------------------------------
  */
 
+using namespace std;
+
 #include "inspircd.h"
 #include "inspircd_io.h"
 #include "inspircd_util.h"
 #include <sys/errno.h>
 #include <sys/ioctl.h>
 #include <sys/utsname.h>
+
 #ifdef USE_KQUEUE
 #include <sys/types.h>
 #include <sys/event.h>
 #include <sys/time.h>
 #endif
+
+#ifdef USE_EPOLL
+#include <sys/epoll.h>
+#endif
+
 #include <cstdio>
 #include <time.h>
 #include <string>
 #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<Module*> modules;
 extern std::vector<ircd_module*> factory;
@@ -177,6 +187,15 @@ void handle_part(char **parameters, int pcnt, userrec *user)
        }
 }
 
+void handle_commands(char **parameters, int pcnt, userrec *user)
+{
+       for (int i = 0; i < command_table.size(); i++)
+       {
+               WriteServ(user->fd,"902 %s :%s %s",user->nick,command_table[i].command,command_table[i].source);
+       }
+       WriteServ(user->fd,"903 %s :End of COMMANDS list");
+}
+
 void handle_kick(char **parameters, int pcnt, userrec *user)
 {
        chanrec* Ptr = FindChan(parameters[0]);
@@ -920,6 +939,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);