Skip to content

Commit

Permalink
doc: websocket: update docs to describe additional callback parameter
Browse files Browse the repository at this point in the history
Update HTTP server documentation and migration guide to account for
added request_ctx parameter to the http_resource_websocket_cb_t
callback.

Signed-off-by: Matt Rodgers <[email protected]>
  • Loading branch information
mrodgers-witekio authored and kartben committed Jan 8, 2025
1 parent 549e5de commit 579e586
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/connectivity/networking/api/http_server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ release it when done.
static int ws_socket;
static uint8_t ws_recv_buffer[1024];
int ws_setup(int sock, void *user_data)
int ws_setup(int sock, struct http_request_ctx *request_ctx, void *user_data)
{
ws_socket = sock;
return 0;
Expand Down
5 changes: 5 additions & 0 deletions doc/releases/migration-guide-4.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,11 @@ Networking
rather than directly in the :c:struct:`http_client_ctx` to correctly handle concurrent requests
on different HTTP/2 streams.

* The HTTP server public API function signature for the :c:type:`http_resource_websocket_cb_t` has
changed, a :c:struct:`http_request_ctx` parameter has been added. The application may use this to
access the request headers of the HTTP upgrade request, which may be useful in deciding whether
to accept or reject a websocket connection.

* The :kconfig:option:`CONFIG_NET_L2_OPENTHREAD` symbol no longer implies the
:kconfig:option:`CONFIG_NVS` Kconfig option. Platforms using OpenThread must explicitly enable
either the :kconfig:option:`CONFIG_NVS` or :kconfig:option:`CONFIG_ZMS` Kconfig option.
Expand Down

0 comments on commit 579e586

Please sign in to comment.