From b616c17e46706e515ea12fa3bc3df8dbb0925f14 Mon Sep 17 00:00:00 2001 From: "Martine S. Lenders" Date: Tue, 9 Aug 2022 16:20:22 +0200 Subject: [PATCH] gcoap: expire memo if there is nothing to wait for --- sys/net/application_layer/gcoap/gcoap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/net/application_layer/gcoap/gcoap.c b/sys/net/application_layer/gcoap/gcoap.c index c6bfb92bbd..567e39b87a 100644 --- a/sys/net/application_layer/gcoap/gcoap.c +++ b/sys/net/application_layer/gcoap/gcoap.c @@ -579,6 +579,11 @@ static void _on_resp_timeout(void *arg) { */ static void _cease_retransmission(gcoap_request_memo_t *memo) { memo->state = GCOAP_MEMO_WAIT; + /* there is also no response handler to wait for => expire memo */ + if (memo->resp_handler == NULL) { + event_timeout_clear(&memo->resp_evt_tmout); + _expire_request(memo); + } } /*