From 0bc1a2b3147d364b5cf6d73c85e629693c9c6b5f Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 31 Jan 2024 10:17:01 +0100 Subject: [PATCH] net: lib: coap: Reduce CoAP server stack usage Declare the CoAP server receiving buffer as static to lower the stack usage. Signed-off-by: Pieter De Gendt --- subsys/net/lib/coap/coap_server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/net/lib/coap/coap_server.c b/subsys/net/lib/coap/coap_server.c index 28d5b8de47f6..e8298506c4a3 100644 --- a/subsys/net/lib/coap/coap_server.c +++ b/subsys/net/lib/coap/coap_server.c @@ -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;