Files
Petre Pircalabu 7f6adb91f7 Fix large files transfer on Windows
The maximum number of bytes to write using TransmitFile cannot be
greater than INT_MAX - 1, otherwise the function fails with WSAEINVAL.

https://docs.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock-transmitfile

The issue can be reproduced using the http-server-sync example, by
sending a GET request for a file larger than INTMAX.

e.g:
$ curl -v http://127.0.0.1:8080/ubuntu.iso -o ubuntu.iso
*   Trying 127.0.0.1:8080...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /ubuntu.iso HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.83.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: Boost.Beast/330
< Content-Type: application/text
< Content-Length: 3654957056
<
{ [0 bytes data]
* transfer closed with 3654957056 bytes remaining to read
  0 3485M    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
curl: (18) transfer closed with 3654957056 bytes remaining to read

Signed-off-by: Petre Pircalabu <ppircalabu@bitdefender.com>
2022-06-21 20:37:43 -03:00
..
2020-03-19 16:21:29 +01:00
2019-03-05 11:09:53 -08:00
2020-01-28 10:24:44 +01:00
2020-09-07 17:26:34 +02:00
2019-03-05 11:09:53 -08:00