1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 14:33:52 +01:00

nanocoap_sock: only abort nanocoap_sock_get_blockwise() on negative error

Some user callbacks might just return the result of some other operation
that returns written bytes or negative error.

Let's not break those, only consider negative callback returns an error.
This commit is contained in:
Benjamin Valentin 2022-04-29 21:29:36 +02:00
parent 5a6bb44660
commit 04a8a36734

View File

@ -403,7 +403,7 @@ int nanocoap_sock_get_blockwise(nanocoap_sock_t *sock, const char *path,
DEBUG("fetching block %u\n", num);
int res = _fetch_block(sock, buf, sizeof(buf), path, blksize, num, &ctx);
if (res) {
if (res < 0) {
DEBUG("error fetching block %u: %d\n", num, res);
return res;
}