![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
#include "nilorea/n_log.h"#include "nilorea/n_network.h"#include "nilorea/n_str.h"#include <string.h>Go to the source code of this file.
Macros | |
| #define | WS_LIMITS_PORT "27431" |
| Port the local listener binds for this test. | |
Functions | |
| static int | check_refused (const char *label, uint64_t len) |
| Drive one hostile length through n_ws_recv and report the outcome. | |
| int | main (void) |
| static int | send_hostile_header (NETWORK *peer, uint64_t len) |
| Send a raw WebSocket frame header naming a payload length of len. | |
| #define WS_LIMITS_PORT "27431" |
Port the local listener binds for this test.
Definition at line 44 of file ex_network_ws_limits.c.
Referenced by check_refused().
|
static |
Drive one hostile length through n_ws_recv and report the outcome.
| label | Human-readable name of the case. |
| len | Payload length the peer declares. |
Definition at line 70 of file ex_network_ws_limits.c.
References N_WS_CONN::connected, free_nstr, LOG_ERR, LOG_INFO, n_log, n_ws_recv(), N_WS_CONN::netw, netw_accept_from(), netw_close(), netw_connect_to(), netw_make_listening(), NETWORK_IPV4, N_WS_MESSAGE::payload, send_hostile_header(), server, and WS_LIMITS_PORT.
Referenced by main().
| int main | ( | void | ) |
Definition at line 123 of file ex_network_ws_limits.c.
References check_refused(), LOG_ERR, LOG_INFO, n_log, N_WS_MAX_PAYLOAD, and set_log_level().
|
static |
Send a raw WebSocket frame header naming a payload length of len.
| peer | Connected socket to write to. |
| len | Payload length to declare in the header. |
Definition at line 52 of file ex_network_ws_limits.c.
References send_data().
Referenced by check_refused().