]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: fix return of quic_dgram_read
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 11 Jan 2022 13:20:46 +0000 (14:20 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 12 Jan 2022 10:08:48 +0000 (11:08 +0100)
It is expected that quic_dgram_read() returns the total number of bytes
read. Fix the return value when the read has been successful. This bug
has no impact as in the end the return value is not checked by the
caller.

src/xprt_quic.c

index 23eae2239a3929b57ab353a33e7f31fd5d12e2fd..558e7048ffedbdae3bfeeec685fa9686fd93f1c2 100644 (file)
@@ -5371,7 +5371,7 @@ static ssize_t quic_dgram_read(struct buffer *buf, size_t len, void *owner,
        if (dgram_ctx.qc)
                dgram_ctx.qc->rx.bytes += len;
 
-       return pos - (unsigned char *)buf;
+       return pos - (unsigned char *)b_head(buf);
 
  err:
        return -1;