WSLAY_EVENT_CON...RECV_MSG_LENGTH(3)

πŸ’– WSLAY_EVENT_CONFIG_SET_MAX_RECV_MSG_LENGTH πŸ’–

okay bestie, come sit with me, we're reading a wslay (section 3) page and it's literally about one little function: wslay_event_config_set_max_recv_msg_length β€” aka "how big is too big for a message around here". 🌸


✨ NAME ✨

wslay_event_config_set_max_recv_msg_length β€” set the maximum length of a message that can be received 🫢


✨ SYNOPSIS ✨

#include <wslay/wslay.h>

void wslay_event_config_set_max_recv_msg_length(wslay_event_context_ptr
ctx, uint64_t val)

like, that's it. that's the whole signature. no return value, she's a void girlie πŸ’…


✨ DESCRIPTION ✨

so wslay_event_config_set_max_recv_msg_length() sets the maximum length of a message that can be received. the vibe check on that length happens inside the wslay_event_recv() function β€” that's the bouncer at the door. πŸšͺ

and if a message is larger than this value? bestie. the reading operation gets disabled (same effect you'd get from calling wslay_event_shutdown_read()), and a close control frame with WSLAY_CODE_MESSAGE_TOO_BIG gets queued. not me being dramatic, that's literally what happens. πŸ’€

one lil' nuance, and it's important so don't skip it: if buffering for non-control frames is disabled, then the library checks each frame payload length and does not check the length of the entire message. so the check is per-frame in that mode, not per-message. πŸ¦‹

the default value is (1u << 31)-1. iconic. generous. giving main character energy with the headroom. ✨


✨ SEE ALSO ✨

  • wslay_event_recv()
  • wslay_event_shutdown_read()

✨ AUTHOR ✨

Tatsuhiro Tsujikawa πŸ‘‘


2024, 2015, Tatsuhiro Tsujikawa


and that's the whole page, bestie!! this lil' beauty comes from wslay, version @PACKAGE_VERSION@, dated Apr 22 β€” go forth and configure your message limits responsibly, no cap. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from