Skip to content

Commit 579e586

Browse files
mrodgers-witekiokartben
authored andcommitted
doc: websocket: update docs to describe additional callback parameter
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]>
1 parent 549e5de commit 579e586

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

doc/connectivity/networking/api/http_server.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ release it when done.
342342
static int ws_socket;
343343
static uint8_t ws_recv_buffer[1024];
344344
345-
int ws_setup(int sock, void *user_data)
345+
int ws_setup(int sock, struct http_request_ctx *request_ctx, void *user_data)
346346
{
347347
ws_socket = sock;
348348
return 0;

doc/releases/migration-guide-4.1.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,11 @@ Networking
367367
rather than directly in the :c:struct:`http_client_ctx` to correctly handle concurrent requests
368368
on different HTTP/2 streams.
369369

370+
* The HTTP server public API function signature for the :c:type:`http_resource_websocket_cb_t` has
371+
changed, a :c:struct:`http_request_ctx` parameter has been added. The application may use this to
372+
access the request headers of the HTTP upgrade request, which may be useful in deciding whether
373+
to accept or reject a websocket connection.
374+
370375
* The :kconfig:option:`CONFIG_NET_L2_OPENTHREAD` symbol no longer implies the
371376
:kconfig:option:`CONFIG_NVS` Kconfig option. Platforms using OpenThread must explicitly enable
372377
either the :kconfig:option:`CONFIG_NVS` or :kconfig:option:`CONFIG_ZMS` Kconfig option.

0 commit comments

Comments
 (0)