mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-29 00:11:16 +01:00
Merge pull request #18221 from benpicco/nanocoap_sock_request_cb-assert
nanocoap_sock: fix wrong assertion
This commit is contained in:
commit
b2ed5af665
@ -175,6 +175,7 @@ ssize_t nanocoap_sock_request_cb(nanocoap_sock_t *sock, coap_pkt_t *pkt,
|
||||
case STATE_RESPONSE_OK:
|
||||
DEBUG("nanocoap: waiting for response (timeout: %"PRIu32" µs)\n",
|
||||
_deadline_left_us(deadline));
|
||||
const void *old_ctx = ctx;
|
||||
tmp = sock_udp_recv_buf(sock, &payload, &ctx, _deadline_left_us(deadline), NULL);
|
||||
/* sock_udp_recv_buf() is supposed to return multiple packet fragments
|
||||
* when called multiple times with the same context.
|
||||
@ -183,7 +184,7 @@ ssize_t nanocoap_sock_request_cb(nanocoap_sock_t *sock, coap_pkt_t *pkt,
|
||||
* releases the packet.
|
||||
* This assertion will trigger should the behavior change in the future.
|
||||
*/
|
||||
if (state != STATE_REQUEST_SEND) {
|
||||
if (old_ctx) {
|
||||
assert(tmp == 0 && ctx == NULL);
|
||||
}
|
||||
if (tmp == 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user