mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
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:
parent
c311a6d181
commit
8ff9dfdea3
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue