This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 8ff9dfdea30 libs: netdb: Advance stream buffers by transfer count
8ff9dfdea30 is described below

commit 8ff9dfdea30a0d86693246de4c814f263d0cb934
Author: Old-Ding <[email protected]>
AuthorDate: Mon Jul 6 09:53:38 2026 +0800

    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 <[email protected]>
---
 libs/libc/netdb/lib_dnsquery.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libs/libc/netdb/lib_dnsquery.c b/libs/libc/netdb/lib_dnsquery.c
index 51740ce58d4..d3231a9adf6 100644
--- a/libs/libc/netdb/lib_dnsquery.c
+++ b/libs/libc/netdb/lib_dnsquery.c
@@ -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;
     }

Reply via email to