mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-06 01:15:43 +00:00
* Cap a send() or wolfSSL_read() length at INT_MAX On 64-bit Windows SocketStream::write() handed size to send(), whose length is an int, so a single write of 4 GiB or more went out as its low 32 bits: a 4 GiB + 1 byte write sent one byte, and write_data() then retried the remaining 4 GiB as zero-byte sends forever. The INT_MAX cap that read() has was limited to 32-bit Windows indf20c27(#1294), when the body was still written with one unchecked write(); write_data() now sends the rest, so the cap applies to every Windows build again. The wolfSSL tls::read() had the same cast, so a read into a buffer over INT_MAX failed. Cap it as the OpenSSL backend has done sincef80864c. * Drop the 4 GiB write test and shorten comments The Windows-only test allocated 4 GiB and took about 5 s, which is too heavy for CI. --------- Co-authored-by: yhirose <yuji.hirose.bug@gmail.com>
1.0 MiB
1.0 MiB