Commit Graph
1477 Commits
Author SHA1 Message Date
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
alandefreitas d362b68edd Set version to 331 2022-06-21 20:36:12 -03:00
alandefreitas 925043e1e8 Update Beast zlib streams
fix #2439
2022-06-03 17:45:32 -03:00
sehe 740879a995 Add http::message_generator 2022-05-21 22:12:13 -07:00
sehe 84e689c447 Add buffers_generator 2022-05-21 22:12:13 -07:00
sehe 344c10ff1e serializer::is_done is const 2022-05-21 22:12:13 -07:00
Vinnie Falco d3f24157b8 silence unreachable code warning 2022-05-21 22:12:13 -07:00
sehe 9d23bec2bc Use core string_view
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
2022-05-10 02:47:28 +02:00
Glen Fernandes 95d9587ea7 Use span from Boost.Core 2022-04-23 00:28:26 -04:00
Glen Fernandes 24275ac0c6 Use static_string from Boost.StaticString 2022-04-17 12:30:52 -04:00
Richard Hodges 17141a331a Set version to 330 2022-03-16 19:23:34 +01:00
Richard Hodges a332f55d63 Set version to 329
close #329
2022-03-09 16:40:43 +01:00
Richard Hodges 5bdd1efb8b Set version to 328 2022-01-14 15:36:20 +01:00
Richard Hodges 29b5f11623 Set version to 327 2022-01-11 14:22:01 +01:00
Richard Hodges b175ca892e Set version to 326
close #2373
2022-01-10 19:20:10 +01:00
Richard Hodges a593738e98 Set version to 325
close #2367
2021-12-22 12:04:12 +01:00
Richard Hodges b5a94db2a5 WebSocket handshake response is deterministic on failure:
Add test for websocket handshake failure HTTP response

fix #2364
close #2365
2021-12-22 12:00:17 +01:00
Richard Hodges 55d2ceb627 Set version to 324
close #2357
close #2280
close #2360
2021-12-10 19:07:39 +01:00
Richard Hodges 6bf9c882a4 Fix open append mode for file_posix 2021-12-10 17:24:03 +01:00
Richard Hodges cf29ecdb63 Fix open append mode for file_win32 2021-12-10 17:22:50 +01:00
vm2mv fb8f57a9e5 Fix file open with append/append_existing flag on Windows 2021-12-10 17:14:16 +01:00
Richard Hodges 1405b5a8eb Set version to 323
close #2356
2021-12-09 14:27:32 +01:00
Peter Dimov 2c06024aa3 Fix clang-cl UTF8 path handling for file_win32:
For file_win32, check _WIN32 instead of BOOST_MSVC

refs #2081
close #2354
2021-12-09 14:27:29 +01:00
Peter Dimov b160673fd9 Fix clang-cl UTF8 path handling for file_stdio:
Check _MSVC_STL_VERSION in addition to BOOST_MSVC, to detect e.g. clang-cl using the MS STL

close #2353
refs #2081
2021-12-09 14:27:24 +01:00
Richard Hodges 94e6f14329 Set version to 322
close #2342
2021-11-12 18:09:08 +01:00
Richard Hodges f16925f2b5 Fix typo in _experimental::test::basic_stream documentation 2021-11-12 16:49:24 +01:00
Richard Hodges 86629991cb Set version to 321 2021-11-03 20:53:28 +01:00
Ed Tanous 071b905bc4 Remove test framework's dependency on RTTI:
Allow unit tests to compile with rtti=off

This struct is only used to make sure that there are no duplication of
test suites.  Move it to a concept that works with RTTI disabled.

Signed-off-by: Ed Tanous <ed@tanous.net>

close #2337
2021-11-03 20:53:28 +01:00
msuvajac 3fd090af3b Port zlib fix for CVE-2016-9840:
Commit ref: https://github.com/madler/zlib/commit/6a043145ca6e9c55184013841a67b2fef87e44c0
Additionally updated lext table to one used in zlib v1.2.11.

close #2314
2021-11-03 19:25:07 +01:00
Hreniuc Cristian-Alexandru 91c0df61d0 Fix reuse of sliding window in WebSocket permessage_deflate:
Original commit message:
Use zlib::Flush::sync instead of zlib::Flush::full, for stream compression

https://github.com/boostorg/beast/issues/2313

fixes #2313
closes #2318
2021-11-03 18:46:53 +01:00
Ed Tanous 4235525c6a Allow test::stream to be used with NORTTI:
Currently, the test stream code doesn't compile when both debug builds
(namely assertions) are enabled along with disabling rtti.  The current
code directly uses type_id(), which isn't available without rtti.

This commit allows stream.hpp to compile without rtti enabled.

Signed-off-by: Ed Tanous <ed@tanous.net>

close #2331
2021-11-03 16:52:48 +01:00
Richard Hodges b15a5ff0e4 Set version to 320
closes #2309
2021-09-04 06:38:29 +02:00
Richard Hodges f65dc21335 Fix missing includes:
Files:
beast/_experimental/test/detail/stream_state.hpp

refs #2295
2021-09-03 21:02:45 +02:00
Richard Hodges 21cd552399 Update version to 319 2021-08-04 10:56:37 +02:00
Richard Hodges 710cc53331 Set version to 318
closes #2255
2021-06-06 19:50:18 +02:00
Richard Hodges 5546086ca9 Remove use of POSIX-only constant
fixes #2233
refs #2231
2021-06-06 16:49:21 +02:00
Richard Hodges 30abfdb9f7 Set version to 317
closes #2246
2021-05-26 21:23:05 +02:00
Richard Hodges bccacab917 Set version to 316
closes #2239
closes #2237
2021-05-22 18:19:10 +02:00
Richard Hodges 47ea201d6e Set version to 315 2021-04-18 15:09:10 +02:00
Richard Hodges 83aaefaf72 Set version to 314 2021-04-06 19:24:51 +02:00
Richard Hodges b7344b0d50 Set version to 313
closes #2207
closes #2201
closes #2191
2021-03-29 12:20:49 +02:00
Michael Haubenschild 31a1fb332a Fix missing check for error code after header is parsed:
The missing error check leads to completely ignoring the body limit,
as the body limit is compared to the "Content-Length" header inside
the "finish_header" method.

closes #2201
2021-03-25 15:04:12 +01:00
dmorilha-twilio 8283a7df3f Fix case where inflated content is larger than out buffer
closes #2191
2021-03-25 14:47:10 +01:00
Richard Hodges 50512cb5cd Set version to 312
closes #2202
2021-03-19 00:40:18 +01:00
Richard Hodges bfc9c71671 Set version to 311 2021-03-16 10:04:12 +01:00
Richard Hodges 1a5aea3d86 Fix MSVC build error 2021-03-15 23:12:00 +01:00
Richard Hodges f814ce1fd7 Set version to 310. 2021-03-09 10:07:31 +01:00
Richard Hodges 50a5e23e1c Set version to 309
closes #2177
2021-03-03 19:35:33 +01:00
Richard Hodges 670f01f050 No undefined behaviour in parser
closes #2172
2021-03-03 19:22:13 +01:00
Richard Hodges 2ab0bd22d9 Set version to 308 2021-03-01 22:34:36 +01:00