summaryrefslogtreecommitdiffstats
path: root/modules/websocket/wsl_peer.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/websocket/wsl_peer.h')
-rw-r--r--modules/websocket/wsl_peer.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/websocket/wsl_peer.h b/modules/websocket/wsl_peer.h
index 07bd850607..45cca48224 100644
--- a/modules/websocket/wsl_peer.h
+++ b/modules/websocket/wsl_peer.h
@@ -53,6 +53,10 @@ private:
// Callbacks.
static ssize_t _wsl_recv_callback(wslay_event_context_ptr ctx, uint8_t *data, size_t len, int flags, void *user_data);
+ static void _wsl_recv_start_callback(wslay_event_context_ptr ctx, const struct wslay_event_on_frame_recv_start_arg *arg, void *user_data);
+ static void _wsl_frame_recv_chunk_callback(wslay_event_context_ptr ctx, const struct wslay_event_on_frame_recv_chunk_arg *arg, void *user_data);
+ static void _wsl_frame_recv_end_callback(wslay_event_context_ptr ctx, void *user_data);
+
static ssize_t _wsl_send_callback(wslay_event_context_ptr ctx, const uint8_t *data, size_t len, int flags, void *user_data);
static int _wsl_genmask_callback(wslay_event_context_ptr ctx, uint8_t *buf, size_t len, void *user_data);
static void _wsl_msg_recv_callback(wslay_event_context_ptr ctx, const struct wslay_event_on_msg_recv_arg *arg, void *user_data);
@@ -80,6 +84,16 @@ private:
Resolver() {}
};
+ struct PendingMessage {
+ size_t payload_size = 0;
+ uint8_t opcode = 0;
+
+ void clear() {
+ payload_size = 0;
+ opcode = 0;
+ }
+ };
+
Resolver resolver;
// WebSocket connection state.
@@ -101,6 +115,7 @@ private:
uint8_t was_string = 0;
uint64_t last_heartbeat = 0;
bool heartbeat_waiting = false;
+ PendingMessage pending_message;
// WebSocket configuration.
bool use_tls = true;