forked from boostorg/beast
Fix all async initiating functions with use_awaitable:
Add trait:
is_completion_token_for
Fixes for
buffered_read_stream
Add tests for
basic_stream
buffered_read_stream
flat_stream
http (all)
websocket (all)
resolves #1920
This commit is contained in:
@@ -14,6 +14,10 @@
|
||||
|
||||
#include <boost/asio/write.hpp>
|
||||
|
||||
#if BOOST_ASIO_HAS_CO_AWAIT
|
||||
#include <boost/asio/use_awaitable.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/config/workaround.hpp>
|
||||
#if BOOST_WORKAROUND(BOOST_GCC, < 80200)
|
||||
#define BOOST_BEAST_SYMBOL_HIDDEN __attribute__ ((visibility("hidden")))
|
||||
@@ -673,10 +677,34 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#if BOOST_ASIO_HAS_CO_AWAIT
|
||||
void testAwaitableCompiles(
|
||||
stream<test::stream>& s,
|
||||
flat_buffer& dynbuf,
|
||||
net::mutable_buffer buf,
|
||||
std::size_t limit)
|
||||
{
|
||||
static_assert(std::is_same_v<
|
||||
net::awaitable<std::size_t>, decltype(
|
||||
s.async_read(dynbuf, net::use_awaitable))>);
|
||||
|
||||
static_assert(std::is_same_v<
|
||||
net::awaitable<std::size_t>, decltype(
|
||||
s.async_read_some(buf, net::use_awaitable))>);
|
||||
|
||||
static_assert(std::is_same_v<
|
||||
net::awaitable<std::size_t>, decltype(
|
||||
s.async_read_some(dynbuf, limit, net::use_awaitable))>);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
run() override
|
||||
{
|
||||
testRead();
|
||||
#if BOOST_ASIO_HAS_CO_AWAIT
|
||||
boost::ignore_unused(&read2_test::testAwaitableCompiles);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user