|
|
@@ -41,6 +41,7 @@ static const char *TAG = "TRANSPORT_WS";
|
|
|
|
|
|
typedef struct {
|
|
|
uint8_t opcode;
|
|
|
+ bool fin; /*!< Frame fin flag, for continuations */
|
|
|
char mask_key[4]; /*!< Mask key for this payload */
|
|
|
int payload_len; /*!< Total length of the payload */
|
|
|
int bytes_remaining; /*!< Bytes left to read of the payload */
|
|
|
@@ -382,6 +383,7 @@ static int ws_read_header(esp_transport_handle_t t, char *buffer, int len, int t
|
|
|
return rlen;
|
|
|
}
|
|
|
ws->frame_state.header_received = true;
|
|
|
+ ws->frame_state.fin = (*data_ptr & 0x80) != 0;
|
|
|
ws->frame_state.opcode = (*data_ptr & 0x0F);
|
|
|
data_ptr ++;
|
|
|
mask = ((*data_ptr >> 7) & 0x01);
|
|
|
@@ -711,6 +713,12 @@ esp_err_t esp_transport_ws_set_config(esp_transport_handle_t t, const esp_transp
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
+bool esp_transport_ws_get_fin_flag(esp_transport_handle_t t)
|
|
|
+{
|
|
|
+ transport_ws_t *ws = esp_transport_get_context_data(t);
|
|
|
+ return ws->frame_state.fin;
|
|
|
+}
|
|
|
+
|
|
|
ws_transport_opcodes_t esp_transport_ws_get_read_opcode(esp_transport_handle_t t)
|
|
|
{
|
|
|
transport_ws_t *ws = esp_transport_get_context_data(t);
|