From 0706b92288955bd9a134d94d7de0d073a1e6ba8b Mon Sep 17 00:00:00 2001 From: Stanislav Ravas Date: Sat, 3 Feb 2024 08:59:39 +0100 Subject: [PATCH] nx_websocket_client_data_process: Return true opcode with fin bit Caller needs this information to detect start of the new websocket frame, and also to detect end of it. Caller must clearly discriminate: - first frame packet, which can further be split into multiple tcp packets - continuation packets, where each can be split into multiple tcp packets - last continuation packet, again split into multiple tcp packets So caller must also take nx_websocket_client_frame_data_received and client.nx_websocket_client_frame_data_length into account. --- addons/websocket/nx_websocket_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/websocket/nx_websocket_client.c b/addons/websocket/nx_websocket_client.c index f335e2d5..ff1e53c8 100644 --- a/addons/websocket/nx_websocket_client.c +++ b/addons/websocket/nx_websocket_client.c @@ -2074,8 +2074,8 @@ UCHAR *data_ptr; case NX_WEBSOCKET_OPCODE_BINARY_FRAME: { - /* Assign the return opcode by the pre-stored opcode */ - *code = client_ptr -> nx_websocket_client_frame_opcode; + /* Assign the return opcode */ + *code = opcode | fin_bit; /* Update the offset by payload length */ offset = payload_length;