Usermode/AxWin3 - Fixed dropped messages due to small buffer size
authorJohn Hodge <[email protected]>
Tue, 10 Sep 2013 09:04:06 +0000 (17:04 +0800)
committerJohn Hodge <[email protected]>
Tue, 10 Sep 2013 09:04:06 +0000 (17:04 +0800)
Usermode/Applications/axwin3_src/WM/ipc.c
Usermode/Applications/axwin3_src/WM/ipc_acess.c

index 7155c11..9cf68e8 100644 (file)
@@ -471,10 +471,16 @@ void IPC_Handle(tIPC_Client *Client, size_t MsgLen, tAxWin_IPCMessage *Msg)
 //     _SysDebug("IPC_Handle: (IPCType=%p, Ident=%p, MsgLen=%i, Msg=%p)",
 //             IPCType, Ident, MsgLen, Msg);
        
-       if( MsgLen < sizeof(tAxWin_IPCMessage) )
+       if( MsgLen < sizeof(*Msg) ) {
+               _SysDebug("IPC_Handle: %p Dropped full undersize message (%i < %i)",
+                       Client, MsgLen, sizeof(*Msg));
                return ;
-       if( MsgLen < sizeof(tAxWin_IPCMessage) + Msg->Size )
+       }
+       if( MsgLen < sizeof(*Msg) + Msg->Size ) {
+               _SysDebug("IPC_Handle: %p Dropped undersize message (%i < %i+%i)",
+                       Client, MsgLen, sizeof(*Msg), Msg->Size);
                return ;
+       }
        
        if( Msg->Flags & IPCMSG_FLAG_RENDERER )
        {
index 534d53d..700b60f 100644 (file)
@@ -12,7 +12,7 @@
 #include <string.h>
 
 // === CONSTANTS ===
-#define STATICBUF_SIZE 64
+#define STATICBUF_SIZE 256
 #define AXWIN_PORT     4101
 
 // === PROTOTYPES ===

UCC git Repository :: git.ucc.asn.au