Correctly keep track of where we are in the quicserver request buffer

If the request comes in in multiple chunks properly keep tract of where
we are.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21578)
This commit is contained in:
Matt Caswell 2023-07-27 15:33:04 +01:00
parent c31f06120f
commit 747b51f483

View File

@ -210,11 +210,11 @@ int main(int argc, char *argv[])
ossl_quic_tserver_tick(qtserv);
if (ossl_quic_tserver_read(qtserv, 0, reqbuf, sizeof(reqbuf),
&numbytes)) {
if (numbytes > 0) {
fwrite(reqbuf, 1, numbytes, stdout);
}
if (ossl_quic_tserver_read(qtserv, 0, reqbuf + reqbytes,
sizeof(reqbuf) - reqbytes,
&numbytes)) {
if (numbytes > 0)
fwrite(reqbuf + reqbytes, 1, numbytes, stdout);
reqbytes += numbytes;
}
} while (reqbytes < sizeof(reqterm)