Skip to content

Commit 7bd04f5

Browse files
committed
[nrf fromtree] net: lib: coap_client: All error cases should be reported to callback
When the client fails when parsing the response and we stop proceeding, we should report that to the application. Signed-off-by: Seppo Takalo <[email protected]> (cherry picked from commit f72d634)
1 parent 945598a commit 7bd04f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

subsys/net/lib/coap/coap_client.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,10 @@ static int handle_response(struct coap_client *client, const struct coap_packet
950950
}
951951
}
952952
fail:
953-
if (ret < 0 || !internal_req->is_observe) {
953+
if (ret < 0) {
954+
report_callback_error(internal_req, ret);
955+
}
956+
if (!internal_req->is_observe) {
954957
release_internal_request(internal_req);
955958
}
956959
return ret;

0 commit comments

Comments
 (0)