Mercurial
view seobeo/s_websocket_common.c @ 125:f236c895604e
[MrJuneJune] Added web socket for chat to this.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Thu, 08 Jan 2026 08:46:49 -0800 |
| parents | |
| children |
line wrap: on
line source
#include "seobeo/seobeo.h" #include "seobeo/seobeo_internal.h" // Mask/unmask data with XOR operation (same for both directions) void Seobeo_WebSocket_Mask_Data(uint8 *data, size_t length, const uint8 *mask) { for (size_t i = 0; i < length; i++) { data[i] ^= mask[i % 4]; } } // Destroy a WebSocket message void Seobeo_WebSocket_Message_Destroy(Seobeo_WebSocket_Message *p_msg) { if (!p_msg) return; if (p_msg->data) free(p_msg->data); free(p_msg); }