Skip to content

Commit a8423b2

Browse files
committed
[nrf fromtree] net: lib: coap_client: Drop duplicate responses
When response is already handled, don't forward anymore responses to the client application. Signed-off-by: Seppo Takalo <[email protected]> (cherry picked from commit a1368a7)
1 parent d99be36 commit a8423b2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

subsys/net/lib/coap/coap_client.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,15 @@ static int handle_response(struct coap_client *client, const struct coap_packet
844844
}
845845
}
846846

847+
if (!internal_req->request_ongoing) {
848+
if (internal_req->is_observe) {
849+
(void) send_rst(client, response);
850+
return 0;
851+
}
852+
LOG_DBG("Drop request, already handled");
853+
goto fail;
854+
}
855+
847856
if (internal_req->pending.timeout != 0) {
848857
coap_pending_clear(&internal_req->pending);
849858
}

0 commit comments

Comments
 (0)