Commit Graph
390 Commits
Author SHA1 Message Date
Mohammad Nejati 9c7777e7f0 ssl_stream and flat_stream are deprecated 2024-05-31 16:45:52 +03:30
Mohammad Nejati 2dcdef3890 Handle expired timers in basic_stream transfer_op
Previously, the code only handled expired timers when the buffer was empty.
2024-05-13 22:17:17 +03:30
Mohammad Nejati e42cf8a1e4 Remove BOOST_BEAST_USE_STD_STRING_VIEW deprecation warning
Closes #2594
2024-02-14 21:15:55 +03:30
Mohammad Nejati e0a9da265f buffers_adaptor::subrange conforms to concept
Fixes #2459
2024-02-07 00:11:14 +03:30
Mohammad Nejati 3b837c6982 Fix unreachable code warning in buffers_cat.hpp
Fixes #2678
2024-01-22 19:55:56 +03:30
Mohammad Nejati c9858357f8 Fix documentation for basic_stream::expires_after
Resolves #2664
2024-01-18 19:39:39 +03:30
Mohammad Nejati 2216adc013 Stronger buffer contract on flat_buffer and flat_static_buffer
Fixes #1513
2024-01-05 12:31:22 +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
Mohammad Nejati dd3f692e7d Use the explicit type std::size_t when completing the transfer_op
Fixes #2766
2023-11-15 12:09:23 +03:30
Mohammad 667e9ea251 Remove detail::bind_default_executor helper 2023-10-26 15:36: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 35d533299c work_guard has license info. 2023-08-18 18:46:28 +08:00
Klemens Morgenstern 915b80a157 set minimum gcc version to 5.0.
This is due to C++98 support being dropped, so 4.8 fails other libraries C++11 detection.
2023-08-17 12:12:43 +08:00
Ed CatmurandEd Catmur a23e24ffee Reimplement (C++23) deprecated std::aligned_storage (#2680)
Use boost::aligned_storage instead of std::.

The latter is deprecated in C++23.

---------

Co-authored-by: Ed Catmur <edward.catmur@mavensecurities.com>
2023-05-15 09:03:10 +08:00
Edward Nolan cd6b79db5a headers using std::int8_t et al. include <csdint>. 2023-05-15 08:49:53 +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 4ff4c79d5b file_body buffer size can be configured. 2023-02-05 02:57:41 +08:00
Klemens 51a73f2e64 Adjusted append docs.
Closes #2568.
2023-02-02 14:00:19 +08:00
Klemens c9900625ea buffers_cat uses BOOST_NORETURN. 2023-01-23 21:18:27 +08:00
Klemens e88185f765 basic_stream doesn't use try-catch with no-exceptions. 2023-01-23 21:18:27 +08:00
Klemens Morgenstern aef9c88c9d error categories use numeric id 2023-01-23 17:48:28 +08:00
Klemens 5032a20d9d operator= is used to assign ecs without loc. 2022-12-22 11:51:22 +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
Dirk Stolle af46c89068 Fix typo in bind_handler.hpp
Closes #2563.
2022-12-07 13:43:16 +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 Morgenstern f4d1936bb2 error_codes use source_location. 2022-10-26 00:06:01 +08:00
Klemens 2820d256e8 Buffers have a feature table.
Closes #891
2022-10-14 17:20:15 +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 541a6bf453 base64::decode initializes local variables.
Closes #2282
2022-10-05 10:04:05 +08:00
sehe 7300ef463b Removed BOOST_BEAST_USE_STD_STRING_VIEW (#2451)
Fixes #2363
2022-10-03 13:29:21 +08:00
alandefreitas fbcc16301d Fix API reference 2022-10-02 22:34:36 +08:00
Ed Catmur 78fc61a9f7 Remove unnecessary constant_time_size for multi_buffer:
http::basic_fields::set_t::size() is unused
core::multi_buffer::list_type::size() is only compared to 1 (in shrink_to_fit()); compare iterators instead.

close #2498
2022-08-24 21:42:22 +02:00
alandefreitas 46729654c1 Remove unused method
fix #2410
2022-06-22 15:07:45 -03:00
alandefreitas eaa51201bd Fix broken links
fix #2333
2022-06-22 15:07:30 -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 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 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