Commit Graph
836 Commits
Author SHA1 Message Date
Mohammad Nejati c5679e40da Turn off warnings for building zlib in the unit tests 2024-03-31 18:59:36 +03:30
Mohammad Nejati bcd65c828e Fix unused parameter warnings in tests 2024-03-31 18:59:36 +03:30
Mohammad Nejati 3d2f982255 Fix narrowing conversion warning in zlib tests 2024-03-31 18:59:36 +03:30
Mohammad Nejati 3e91357daa Fix OpenSSL builds in GHA CI 2024-03-28 18:08:52 +03:30
Mohammad Nejati e0a9da265f buffers_adaptor::subrange conforms to concept
Fixes #2459
2024-02-07 00:11:14 +03:30
Mohammad Nejati 25105e476a Update status code list to conform with IANA registry
https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml

Resolves #2729
2024-02-06 18:09:48 +03:30
Mohammad Nejati 6adca47bbe Fix unused-result warning in deferred.cpp 2024-01-18 22:57:29 +03:30
Mohammad Nejati a1784e3093 Add missing headers to file_test.hpp 2024-01-18 19:17:07 +03:30
Mohammad Nejati 9e16754dd5 Add non-allocating overload for error category message function
Fixes #2646
2024-01-03 18:21:52 +03:30
Mohammad 0d1e2d64f8 Replace beast::bind_front_handler uses with asio::prepend 2023-12-30 08:47:32 +03:30
Mohammad Nejati 3df5d980d0 Specialize asio::associator for bind_wrapper and bind_front_wrapper 2023-12-29 13:10:30 +03:30
Klemens Morgenstern 3996cae768 allocate & invoke hooks are removed. 2023-10-26 12:33:24 +03:30
Klemens Morgenstern dd875463ff immediate_executor is supported. (#2672) 2023-10-13 05:33:23 -03:00
Mohammad 45d4f7f306 Replace BOOST_ASIO_INITFN_RESULT_TYPE with BOOST_ASIO_INITFN_AUTO_RESULT_TYPE
asio::deferred doesn't work with BOOST_ASIO_INITFN_RESULT_TYPE
Fixes #2727.
2023-09-05 08:54:08 +03:30
Klemens Morgenstern af5240f6f1 cancel test allows reset connection in tests. 2023-06-23 09:49:54 +08:00
Klemens Morgenstern a4a90af541 all asan uses ucontext. 2023-06-23 09:49:54 +08:00
Klemens Morgenstern 7625ec7531 OSX ASan uses ucontext. 2023-05-12 13:10:53 +08:00
Klemens Morgenstern 42b6387ae4 Fixes for MSVC 2022 issues.
Closes #2653.
2023-03-22 16:11:06 +08:00
Edward NolanandEdward Nolan 8dc6daa507 Address bind_handler ambiguous overload error when boost/bind/std_placeholders.hpp is included (#2638)
* Address bind_handler ambiguous overload error when boost/bind/std_placeholders.hpp is included

Previously, the implementation of bind_handler made the assumption
that the trait boost::is_placeholder would be false for types
corresponding to values in the std::placeholders namespace.

However, boost/bind commit c85b31e3d200dda2a73cf0027a82c6d8e29066f8,
`Support use of standard placeholders with boost::bind`, added a new
header, boost/bind/std_placeholders.hpp, which adds specializations to
 boost::is_placeholder for std::placeholders types.

When this header is included before a use of boost::bind_handler, it
results in compiler errors like the following, due to an internal
helper function having overloads for
enable_if<boost::is_placeholder...> and
enable_if<std::is_placeholder...>, which were previously assumed to be
mutually exclusive, but for which both conditions now are true:

../../../boost/beast/core/detail/bind_handler.hpp:126:18: error: call of overloaded 'extract(std::_Placeholder<1>, boost::beast::detail::tuple<int&&>)' is ambiguous
  126 |         h(extract(detail::get<S>(std::move(args)),
      |           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  127 |             std::forward<ValsTuple>(vals))...);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This header is included in boost/bind/bind.hpp, and is transitively
included by headers in many boost libraries including:

algorithm
asio
atomic
graph
msm
multi_index
property_tree
ptr_container
python
signals2
test
thread

Making it possible that an include from one of these libraries will
randomly cause bind_handler to fail to compile.

This change addresses the issue by eliminating one of the ambiguous
overloads and ensuring that boost/bind/std_placeholders.hpp is
included in the bind_handler implementation file, so that the
enable_if<boost::is_placeholder...> overload can handle both
boost::placeholders and std::placeholders values. It also explicitly
adds a boost/bind/std_placeholders.hpp include to the bind_handler
unit test to prevent this issue from regressing.

* Address boost/bind/std_placeholders.hpp feature guards

boost/bind/std_placeholders.hpp has the following feature guards:

if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)

If this check fails, it will not detect std::placeholders values as
placeholders, making the previous solution fail.

This update restores the std::is_placeholder overload and adjusts the
SFINAE for the boost::is_placeholder overload so that it triggers only
if std::is_placeholder is false, making bind_handler work regardless
of whether std_placeholders.hpp's feature guard applies.

---------

Co-authored-by: Edward Nolan <enolan@maystreet.com>
2023-02-17 13:50:04 +08:00
Klemens 1d965752b2 beast file_body & file support seek.
win32 file_body handles seek correctly.
Added seek to win32 file.
file_body_writer handles offsets.
2023-02-05 02:57:41 +08:00
Klemens 99bceb5bff examples & tests use context instead of coroutine. 2023-02-02 23:27:49 +08:00
Klemens 97ece405b8 rebind test uses ignore_unused. 2023-01-04 08:44:00 +08:00
Klemens 334b9871be Fixed timer usage inside basic_stream.
Closes #2602.
2022-12-24 09:40:08 +08:00
Klemens f7079044a7 websocket tests have larger timeouts.
The tests fail on freebsd.
2022-12-20 18:01:12 +08:00
Klemens Morgenstern 48f82ac817 Switched self-posting to the io-object's executor.
This is a conceptual change in the recent asio version that is reflected in any_completion_handler.
2022-12-20 14:45:26 +08:00
Klemens 860bfbdeab Added source-location to all ecs.
Closes #2475.
2022-12-20 13:16:39 +08:00
Christopher Kohlhoff 19f91bcb32 Tests adopting asio code changes for asio 1.25.0. 2022-11-01 14:45:54 +08:00
Klemens Morgenstern 1fc340713c beast support default completion & rebind.
buffers_generator uses default_completion.
websocket::stream has a rebinding constructor.
ssl_stream has a rebind_executor member.
basic_stream has rebinding constructor.
2022-10-30 00:13:54 +08:00
Klemens 3ebff60b1a beast support per-op cancellation
- websocket supports cancellation.
 - Iterating test for ws cancellation.
 - Only terminal cancellation is forwarded by default.
 - basic_stream supports cancellation.
 - supported cancellation is documented.
 - http cancellation additions.
 - Added cancellation_slot tests to http, utils and saved_handler.
 - Added post to write.cpp, to avoid SIGSEV in test.
 - Refresher describes cancellation in more detail.
2022-10-27 22:56:19 +08:00
Klemens 3869d472ec buffer_adaptors uses the correct begin function. 2022-10-14 17:20:15 +08:00
Klemens 9d680df683 buffer_ref allows using beast buffers with asio. 2022-10-14 17:20:15 +08:00
Klemens 606d776ebb async_read works with dynamic_buffer v2. 2022-10-14 17:20:15 +08:00
Klemens Morgenstern b0c49748a2 Support expect continue in upgrade.
Closes #264.
2022-10-13 09:26:08 +08:00
Klemens 01dd53d665 Empty header values are allowed & documented. 2022-10-10 14:39:46 +08:00
alandefreitas bd69638e9d per-message compression options
fix #226, #227
2022-10-03 09:25:31 +08:00
alandefreitas 5866e50438 Add multiple content length error
fix #2468
2022-10-02 20:04:46 +08:00
Richard Hodges 3f7f2572b0 Workaround TSAN CI bug
fix #2499
2022-08-16 10:29:27 +02:00
sehe 4f3276fd70 Exclude unused zlib sources from build
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.
2022-06-22 15:10:01 -03:00
alandefreitas 0ed09e59d9 Fix zlib warnings
fix #2461
2022-06-22 15:06:23 -03:00
alandefreitas 925043e1e8 Update Beast zlib streams
fix #2439
2022-06-03 17:45:32 -03:00
JackyYin ca824f607c Update zlib from 1.2.11 to 1.2.12
fix #2439

Because there is a CVE issue impact zlib before 1.2.12,
update zlib to avoid any related problems.

Please check the link below for detailed CVE information:
https://access.redhat.com/security/cve/CVE-2018-25032
2022-06-03 17:43:42 -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
Vinnie Falco 746c1bb598 silence nodiscard warning in test 2022-05-21 22:12:13 -07:00
Vinnie Falco 6c9e9ea243 Tests are fat binaries 2022-05-21 22:12:13 -07: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
Martijn Otto 6ff7beae48 Add missing include for file_body test
close #2391
2022-03-09 16:35:24 +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 cf29ecdb63 Fix open append mode for file_win32 2021-12-10 17:22:50 +01:00