]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - win/inspircd_namedpipe.cpp
Change display of PROP list to match the input format
[user/henk/code/inspircd.git] / win / inspircd_namedpipe.cpp
index 18ef9b9cb5805bdf7c9b653787b02b7418481204..76d16037bf721bb51fe1e9286fc2b6fefa2e440d 100644 (file)
@@ -6,7 +6,7 @@
 #include <psapi.h>\r
 \r
 \r
-IPCThread::IPCThread(InspIRCd* Instance) : Thread(), ServerInstance(Instance)\r
+IPCThread::IPCThread()\r
 {\r
        if (!initwmi())\r
                ServerInstance->Logs->Log("IPC", DEBUG, "Could not initialise WMI. CPU percantage reports will not be available.");\r
@@ -25,14 +25,14 @@ void IPCThread::Run()
        {\r
                Pipe = CreateNamedPipe (Pipename,\r
                                        PIPE_ACCESS_DUPLEX, // read/write access\r
-                                        PIPE_TYPE_MESSAGE | // message type pipe\r
-                                        PIPE_READMODE_MESSAGE | // message-read mode\r
-                                        PIPE_WAIT, // blocking mode\r
-                                        PIPE_UNLIMITED_INSTANCES, // max. instances\r
-                                        MAXBUF, // output buffer size\r
-                                        MAXBUF, // input buffer size\r
-                                        1000, // client time-out\r
-                                        NULL); // no security attribute\r
+                                       PIPE_TYPE_MESSAGE | // message type pipe\r
+                                       PIPE_READMODE_MESSAGE | // message-read mode\r
+                                       PIPE_WAIT, // blocking mode\r
+                                       PIPE_UNLIMITED_INSTANCES, // max. instances\r
+                                       MAXBUF, // output buffer size\r
+                                       MAXBUF, // input buffer size\r
+                                       1000, // client time-out\r
+                                       NULL); // no security attribute\r
 \r
                if (Pipe == INVALID_HANDLE_VALUE)\r
                {\r
@@ -127,11 +127,11 @@ void IPCThread::SetResult(int newresult)
 }\r
 \r
 \r
-IPC::IPC(InspIRCd* Srv) : ServerInstance(Srv)\r
+IPC::IPC()\r
 {\r
        /* The IPC pipe is threaded */\r
-       thread = new IPCThread(Srv);\r
-       Srv->Threads->Create(thread);\r
+       thread = new IPCThread();\r
+       ServerInstance->Threads->Start(thread);\r
 }\r
 \r
 void IPC::Check()\r
@@ -161,6 +161,12 @@ void IPC::Check()
                        thread->ClearStatus();\r
                        ServerInstance->Restart("Restarting due to command from GUI");\r
                break;\r
+               case '4':\r
+                       /* Toggle debug */\r
+                       thread->SetResult(0);\r
+                       thread->ClearStatus();\r
+                       ServerInstance->Config->forcedebug = !ServerInstance->Config->forcedebug;\r
+               break;\r
        }\r
 }\r
 \r
@@ -168,4 +174,4 @@ IPC::~IPC()
 {\r
        thread->SetExitFlag();\r
        delete thread;\r
-}
\ No newline at end of file
+}\r