Skip to content

Commit

Permalink
net: lib: coap: Reduce CoAP server stack usage
Browse files Browse the repository at this point in the history
Declare the CoAP server receiving buffer as static to lower the
stack usage.

Signed-off-by: Pieter De Gendt <[email protected]>
  • Loading branch information
pdgendt authored and carlescufi committed Feb 2, 2024
1 parent a97c825 commit 0bc1a2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion subsys/net/lib/coap/coap_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ static int coap_service_remove_observer(const struct coap_service *service,

static int coap_server_process(int sock_fd)
{
uint8_t buf[CONFIG_COAP_SERVER_MESSAGE_SIZE];
static uint8_t buf[CONFIG_COAP_SERVER_MESSAGE_SIZE];

struct sockaddr client_addr;
socklen_t client_addr_len = sizeof(client_addr);
struct coap_service *service = NULL;
Expand Down

0 comments on commit 0bc1a2b

Please sign in to comment.