Skip to content

Commit c63e5ff

Browse files
SyverHaraldsennordicjm
authored andcommitted
net: downloader: coap: Fix CoAP retransmission errno comparison
Fix errno comparison for CoAP transport to use negative values. This prevents retransmission requests from being ignored. Signed-off-by: Syver Haraldsen <[email protected]>
1 parent cdb6345 commit c63e5ff

File tree

1 file changed

+2
-1
lines changed
  • subsys/net/lib/downloader/src/transports

1 file changed

+2
-1
lines changed

subsys/net/lib/downloader/src/transports/coap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,9 +541,10 @@ static int dl_coap_download(struct downloader *dl)
541541
len = dl_socket_recv(coap->sock.fd, dl->cfg.buf + dl->buf_offset,
542542
dl->cfg.buf_size - dl->buf_offset);
543543
if (len < 0) {
544-
if ((len == ETIMEDOUT) || (len == EWOULDBLOCK) || (len == EAGAIN)) {
544+
if ((len == -ETIMEDOUT) || (len == -EWOULDBLOCK) || (len == -EAGAIN)) {
545545
/* Request data again */
546546
coap->retransmission_req = true;
547+
LOG_DBG("CoAP recv failed with error: %d, retransmission requested", len);
547548
return 0;
548549
}
549550

0 commit comments

Comments
 (0)