webMAN-MOD
webMAN-MOD copied to clipboard
Small change in PS3MAPI's server client handling code (clearing input buffer)
in ps3mapi.h in handleclient_ps3map WMM doesn't clear the input buffer after the command checking with
memset(&buffer[0], 0x00, PS3MAPI_RECV_SIZE);
The reason for that is I've noticed in the decompiled PS3MAPI DLL code, that everytime the DLL sends a request, it first re-establishes a silent reconnection before actually sending a command to the PS3. I guess it does it to release all socket data? Ok, generally IMO the DLL is not very good coded (I still respect NzV's work) which lead me creating a new and more optimized PS3MAPI library, however, it didn't really work out well. When sending multiple commands without disconnecting and reconnecting, it only sent the first command correctly, the rest just didn't execute. I've seen in the WMM code that after checking through all the commands, WMM doesn't clear the input buffer, so the client socket will just start overwriting parts of the buffer and therefore WMM stores parts of the old and new command. By clearing the buffer with memset, the client will send and webman receive correctly. While I haven't tested the code on PS3, I've tested it on Windows (since Berkeley Socket and Winsock are extremely similar) and here are my results:
Without memset solution: client -> hello world server -> hello world client -> pex server -> pexlo world client -> cxy server -> cxylo world
with memset solution: client -> hello world server -> hello world client -> pex server -> pex client -> cxy server -> cxy
It's a great IMO, it's just a line of code that shouldn't affect the performance of WMM and can improve performance from the client-side dramatically (once I've created the new and optimized library and tested it.)
A new build has been uploaded to fix this issue. You can download it from the release page or from online updater