From 8fbe440f8aaa68d6bfcb25e2ad8e68404a38f0ef Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Tue, 26 Jul 2022 09:04:53 +0100 Subject: [PATCH] coap_io.c: Updates for esp-idf port --- include/coap3/coap_mutex.h | 1 + src/coap_io.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/coap3/coap_mutex.h b/include/coap3/coap_mutex.h index e414b16a..a9cbc1cc 100644 --- a/include/coap3/coap_mutex.h +++ b/include/coap3/coap_mutex.h @@ -46,6 +46,7 @@ typedef mutex_t coap_mutex_t; #else /* define stub mutex functions */ +#warning "stub mutex functions" typedef int coap_mutex_t; #define COAP_MUTEX_INITIALIZER 0 #define coap_mutex_lock(a) *(a) = 1 diff --git a/src/coap_io.c b/src/coap_io.c index 53ffa252..7f9c4136 100644 --- a/src/coap_io.c +++ b/src/coap_io.c @@ -1132,7 +1132,9 @@ coap_io_prepare_io(coap_context_t *ctx, coap_session_t *s, *rtmp; coap_tick_t timeout = 0; coap_tick_t s_timeout; +#if COAP_SERVER_SUPPORT int check_dtls_timeouts = 0; +#endif /* COAP_SERVER_SUPPORT */ #ifdef COAP_EPOLL_SUPPORT (void)sockets; (void)max_sockets; @@ -1173,8 +1175,10 @@ coap_io_prepare_io(coap_context_t *ctx, if (timeout == 0 || tls_timeout - now < timeout) timeout = tls_timeout - now; } +#if COAP_SERVER_SUPPORT } else { check_dtls_timeouts = 1; +#endif /* COAP_SERVER_SUPPORT */ } } #if COAP_SERVER_SUPPORT