Merge branch 'bugfix/ws_server_async_send_fin' into 'master'

http_server example: WebSocket server to set final flag in async messages

Closes IDFGH-3443

See merge request espressif/esp-idf!9251
This commit is contained in:
David Čermák
2020-07-15 05:31:02 +08:00
3 changed files with 19 additions and 3 deletions

View File

@@ -1530,7 +1530,15 @@ typedef enum {
* @brief WebSocket frame format
*/
typedef struct httpd_ws_frame {
bool final; /*!< Final frame */
bool final; /*!< Final frame:
For received frames this field indicates whether the `FIN` flag was set.
For frames to be transmitted, this field is only used if the `fragmented`
option is set as well. If `fragmented` is false, the `FIN` flag is set
by default, marking the ws_frame as a complete/unfragmented message
(esp_http_server doesn't automatically fragment messages) */
bool fragmented; /*!< Indication that the frame allocated for transmission is a message fragment,
so the `FIN` flag is set manually according to the `final` option.
This flag is never set for received messages */
httpd_ws_type_t type; /*!< WebSocket frame type */
uint8_t *payload; /*!< Pre-allocated data buffer */
size_t len; /*!< Length of the WebSocket data */