libs: netdb: Advance stream buffers by transfer count

Update the DNS stream send and receive helpers to advance their buffers
by the number of bytes actually transferred. Advancing by the original
remaining length skips data when send() or recv() completes partially.

Signed-off-by: Old-Ding <ai.neo.ae86@gmail.com>
This commit is contained in:
Old-Ding 2026-07-06 09:53:38 +08:00 committed by Xiang Xiao
parent c311a6d181
commit 8ff9dfdea3

View file

@ -140,7 +140,7 @@ static ssize_t stream_send(int fd, FAR const void *buf, size_t len)
break;
}
buf = (FAR const uint8_t *)buf + len;
buf = (FAR const uint8_t *)buf + ret;
len -= ret;
total += ret;
}
@ -186,7 +186,7 @@ static ssize_t stream_recv(int fd, FAR void *buf, size_t len)
break;
}
buf = (FAR uint8_t *)buf + len;
buf = (FAR uint8_t *)buf + ret;
len -= ret;
total += ret;
}