X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin2_src%2FWM%2Fmessages.c;fp=Usermode%2FApplications%2Faxwin2_src%2FWM%2Fmessages.c;h=6fd01c55c0307b9119264f1002abcab95f35ed2b;hb=f737fb47a583fca5c922604d419ab744609308df;hp=7c7c7178a794a8a8d59bb5e945bcfc32f8ea9606;hpb=3dedfe567817548ecc164ab497bcbb2395045659;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin2_src/WM/messages.c b/Usermode/Applications/axwin2_src/WM/messages.c index 7c7c7178..6fd01c55 100644 --- a/Usermode/Applications/axwin2_src/WM/messages.c +++ b/Usermode/Applications/axwin2_src/WM/messages.c @@ -66,11 +66,11 @@ void IPC_HandleSelect(fd_set *set) readlen = read(giNetworkFileHandle, sizeof(staticBuf), staticBuf); - // Assume that all connections are from localhost identlen = 4 + Net_GetAddressSize( ((uint16_t*)staticBuf)[1] ); msg = staticBuf + identlen; IPC_Handle(&gIPC_Type_Datagram, staticBuf, readlen - identlen, (void*)msg); + _SysDebug("IPC_HandleSelect: UDP handled"); } while(SysGetMessage(NULL, NULL)) @@ -81,6 +81,7 @@ void IPC_HandleSelect(fd_set *set) SysGetMessage(NULL, data); IPC_Handle(&gIPC_Type_SysMessage, &tid, len, (void*)data); + _SysDebug("IPC_HandleSelect: Message handled"); } } @@ -89,6 +90,9 @@ void IPC_Handle(tIPC_Type *IPCType, void *Ident, size_t MsgLen, tAxWin_Message * tApplication *app; tElement *ele; + _SysDebug("IPC_Handle: (IPCType=%p, Ident=%p, MsgLen=%i, Msg=%p)", + IPCType, Ident, MsgLen, Msg); + if( MsgLen < sizeof(tAxWin_Message) ) return ; if( MsgLen < sizeof(tAxWin_Message) + Msg->Size ) @@ -100,6 +104,7 @@ void IPC_Handle(tIPC_Type *IPCType, void *Ident, size_t MsgLen, tAxWin_Message * { // --- Ping message (reset timeout and get server version) case MSG_SREQ_PING: + _SysDebug(" IPC_Handle: MSG_SREQ_PING"); if( MsgLen < sizeof(tAxWin_Message) + 4 ) return; Msg->ID = MSG_SRSP_VERSION; Msg->Size = 4; @@ -112,8 +117,10 @@ void IPC_Handle(tIPC_Type *IPCType, void *Ident, size_t MsgLen, tAxWin_Message * // --- Register an application case MSG_SREQ_REGISTER: + _SysDebug(" IPC_Handle: MSG_SREQ_REGISTER"); if( Msg->Data[Msg->Size-1] != '\0' ) { // Invalid message + _SysDebug("IPC_Handle: RETURN - Not NULL terminated"); return ; } @@ -128,6 +135,7 @@ void IPC_Handle(tIPC_Type *IPCType, void *Ident, size_t MsgLen, tAxWin_Message * // --- Create a window case MSG_SREQ_ADDWIN: + _SysDebug(" IPC_Handle: MSG_SREQ_ADDWIN"); if( Msg->Data[Msg->Size-1] != '\0' ) { // Invalid message return ; @@ -139,11 +147,13 @@ void IPC_Handle(tIPC_Type *IPCType, void *Ident, size_t MsgLen, tAxWin_Message * // --- Set a window's icon case MSG_SREQ_SETICON: + _SysDebug(" IPC_Handle: MSG_SREQ_SETICON"); // TODO: Find a good way of implementing this break; // --- Create an element case MSG_SREQ_INSERT: { + _SysDebug(" IPC_Handle: MSG_SREQ_INSERT"); struct sAxWin_SReq_NewElement *info = (void *)Msg->Data; if( Msg->Size != sizeof(*info) ) return;