Recent update zlib-1.2.11->1.2.12 included included a number of source
files in the Bjam/CMake changes that were previously excluded.
This leads to a bunch of C99 violation warnings (implicit function
declarations).
This commit excludes the culprits again, but leaves them actively
commented-out so the same mistake is less likely to happen by accident
in the future.
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>
fix#2417
This improves inter-conversion between string_view implementations. Some observable differences for users:
- core::string_view no longer supports the .to_string() or .clear() extensions from Utility
- code that relied on .max_size() returning .size(), needs to be fixed to .size() instead
- remove_suffix() and remove_prefix() were more lenient than the standard specs; be sure you don't rely on it clamping the argument to valid range
- BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS no longer suppresses conversions to std::string
- core::string_view adds .contains() and various bugs fixed
Merges PR#2414
I used this example to start building my WebSocket application, however, I noticed that upon removing the echoing in the on_read method, the server repeatedly throws errors without exiting the method.
You can recreate this problem by replacing the async_write with do_write and cause any error (i.e. client reloads the page).
Adding a return statement here would make debugging for future changes much easier and it wouldn't harm the existing echoing in any way.