diff --git a/doc/qbk/03_core/_core.qbk b/doc/qbk/03_core/_core.qbk index 2a55c7d2..5fee997f 100644 --- a/doc/qbk/03_core/_core.qbk +++ b/doc/qbk/03_core/_core.qbk @@ -15,8 +15,8 @@ scheduled to become an official part of C++ no sooner than the year 2023. Three implementations exist, with cosmetic differences but otherwise using the same function signatures and type declarations: Boost.Asio, stand-alone Asio, and networking-ts-impl. This table shows -how a variable of the each library's `io_context` type is declared by -including the appropriate header and using a suitable namespace alias: +how a variable of type `io_context` is declared in each implementation +by including the appropriate header and using a suitable namespace alias: [table Networking Implementations [[Name][Namespace and Header Example ]] diff --git a/doc/qbk/main.qbk b/doc/qbk/main.qbk index e52a909a..e0774a33 100644 --- a/doc/qbk/main.qbk +++ b/doc/qbk/main.qbk @@ -87,6 +87,7 @@ [def __Body__ [link beast.concepts.Body ['Body]]] [def __BodyReader__ [link beast.concepts.BodyReader ['BodyReader]]] [def __BodyWriter__ [link beast.concepts.BodyWriter ['BodyWriter]]] +[def __BufferSequence__ [link beast.concepts.BufferSequence ['BufferSequence]]] [def __DynamicBuffer__ [link beast.concepts.DynamicBuffer ['DynamicBuffer]]] [def __Fields__ [link beast.concepts.Fields ['Fields]]] [def __FieldsWriter__ [link beast.concepts.FieldsWriter ['FieldsWriter]]] diff --git a/doc/source.dox b/doc/source.dox index d5ecd7c4..d43103fc 100644 --- a/doc/source.dox +++ b/doc/source.dox @@ -1,3 +1,57 @@ +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = \ + $(LIB_DIR)/include/boost/beast/ \ + $(LIB_DIR)/include/boost/beast/_experimental/http \ + $(LIB_DIR)/include/boost/beast/_experimental/test \ + $(LIB_DIR)/include/boost/beast/core \ + $(LIB_DIR)/include/boost/beast/http \ + $(LIB_DIR)/include/boost/beast/ssl \ + $(LIB_DIR)/include/boost/beast/websocket \ + $(LIB_DIR)/include/boost/beast/zlib + + +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = ../ +INCLUDE_FILE_PATTERNS = + +PREDEFINED = \ + BOOST_BEAST_DOXYGEN \ + BOOST_BEAST_USE_POSIX_FILE=1 \ + BOOST_BEAST_USE_WIN32_FILE=1 \ + BOOST_BEAST_SPLIT_COMPILATION=1 \ + BOOST_BEAST_ASYNC_RESULT1(t)=__deduced__ \ + BOOST_BEAST_ASYNC_RESULT1(t)=__deduced__ \ + BOOST_ASIO_INITFN_RESULT_TYPE(t,a)=__deduced__ \ + GENERATING_DOCUMENTATION \ + BOOST_BEAST_DECL +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES + #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- @@ -99,37 +153,6 @@ WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = \ - $(LIB_DIR)/include/boost/beast/ \ - $(LIB_DIR)/include/boost/beast/_experimental/http \ - $(LIB_DIR)/include/boost/beast/_experimental/test \ - $(LIB_DIR)/include/boost/beast/core \ - $(LIB_DIR)/include/boost/beast/http \ - $(LIB_DIR)/include/boost/beast/ssl \ - $(LIB_DIR)/include/boost/beast/websocket \ - $(LIB_DIR)/include/boost/beast/zlib - - -INPUT_ENCODING = UTF-8 -FILE_PATTERNS = -RECURSIVE = NO -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXCLUDE_SYMBOLS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -FILTER_SOURCE_PATTERNS = -USE_MDFILE_AS_MAINPAGE = - #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- @@ -227,27 +250,6 @@ GENERATE_XML = YES XML_OUTPUT = $(XML_OUTPUT) XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = YES -SEARCH_INCLUDES = YES -INCLUDE_PATH = ../ -INCLUDE_FILE_PATTERNS = - -PREDEFINED = \ - BOOST_BEAST_DOXYGEN \ - BOOST_BEAST_USE_POSIX_FILE=1 \ - BOOST_BEAST_USE_WIN32_FILE=1 \ - BOOST_BEAST_SPLIT_COMPILATION=1 \ - BOOST_ASIO_INITFN_RESULT_TYPE(t,a)=__deduced__ \ - GENERATING_DOCUMENTATION \ - BOOST_BEAST_DECL -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES - #--------------------------------------------------------------------------- # Configuration options related to external references #--------------------------------------------------------------------------- diff --git a/include/boost/beast.hpp b/include/boost/beast.hpp index f2d74ed8..458f20a7 100644 --- a/include/boost/beast.hpp +++ b/include/boost/beast.hpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) +// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/boost/beast/_experimental/http/icy_stream.hpp b/include/boost/beast/_experimental/http/icy_stream.hpp index 2eb0c6e1..e546bdd0 100644 --- a/include/boost/beast/_experimental/http/icy_stream.hpp +++ b/include/boost/beast/_experimental/http/icy_stream.hpp @@ -227,8 +227,7 @@ public: template< class MutableBufferSequence, class ReadHandler> - BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_some( MutableBufferSequence const& buffers, ReadHandler&& handler); @@ -309,8 +308,7 @@ public: template< class ConstBufferSequence, class WriteHandler> - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some( ConstBufferSequence const& buffers, WriteHandler&& handler); diff --git a/include/boost/beast/_experimental/http/impl/icy_stream.hpp b/include/boost/beast/_experimental/http/impl/icy_stream.hpp index 3879dd5c..8e9a46b8 100644 --- a/include/boost/beast/_experimental/http/impl/icy_stream.hpp +++ b/include/boost/beast/_experimental/http/impl/icy_stream.hpp @@ -473,8 +473,7 @@ template template< class MutableBufferSequence, class ReadHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) icy_stream:: async_read_some( MutableBufferSequence const& buffers, @@ -526,8 +525,7 @@ template template< class MutableBufferSequence, class WriteHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) icy_stream:: async_write_some( MutableBufferSequence const& buffers, diff --git a/include/boost/beast/_experimental/test/impl/stream.hpp b/include/boost/beast/_experimental/test/impl/stream.hpp index 3cc5dfce..c117bbbd 100644 --- a/include/boost/beast/_experimental/test/impl/stream.hpp +++ b/include/boost/beast/_experimental/test/impl/stream.hpp @@ -304,8 +304,7 @@ read_some(MutableBufferSequence const& buffers, } template -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) stream:: async_read_some( MutableBufferSequence const& buffers, @@ -384,8 +383,7 @@ write_some( } template -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) stream:: async_write_some( ConstBufferSequence const& buffers, diff --git a/include/boost/beast/_experimental/test/stream.hpp b/include/boost/beast/_experimental/test/stream.hpp index 7eb71ba7..37f7df0f 100644 --- a/include/boost/beast/_experimental/test/stream.hpp +++ b/include/boost/beast/_experimental/test/stream.hpp @@ -431,8 +431,7 @@ public: operation completes. */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_some(MutableBufferSequence const& buffers, ReadHandler&& handler); @@ -509,8 +508,7 @@ public: to ensure that all data is written before the asynchronous operation completes. */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some(ConstBufferSequence const& buffers, WriteHandler&& handler); diff --git a/include/boost/beast/core/async_base.hpp b/include/boost/beast/core/async_base.hpp index a301ccc2..10c2f3c5 100644 --- a/include/boost/beast/core/async_base.hpp +++ b/include/boost/beast/core/async_base.hpp @@ -78,7 +78,7 @@ namespace beast { // Asynchronously read into a buffer until the buffer is full, or an error occurs template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (error_code, std::size_t)) + typename net::async_result::return_type async_read(AsyncReadStream& stream, net::mutable_buffer buffer, ReadHandler&& handler) { using handler_type = BOOST_ASIO_HANDLER_TYPE(ReadHandler, void(error_code, std::size_t)); diff --git a/include/boost/beast/core/basic_stream.hpp b/include/boost/beast/core/basic_stream.hpp index 9f2dcfc1..a44fabd8 100644 --- a/include/boost/beast/core/basic_stream.hpp +++ b/include/boost/beast/core/basic_stream.hpp @@ -905,8 +905,7 @@ public: @see @ref async_connect */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler, - void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(ConnectHandler) async_connect( endpoint_type const& ep, ConnectHandler&& handler); @@ -963,8 +962,7 @@ public: EndpointSequence>::value>::type #endif > - BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler, - void (error_code, typename Protocol::endpoint)) + BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void (error_code, typename Protocol::endpoint)) async_connect( EndpointSequence const& endpoints, RangeConnectHandler&& handler); @@ -1053,8 +1051,7 @@ public: EndpointSequence>::value>::type #endif > - BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler, - void (error_code, typename Protocol::endpoint)) + BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void (error_code, typename Protocol::endpoint)) async_connect( EndpointSequence const& endpoints, ConnectCondition connect_condition, @@ -1107,8 +1104,7 @@ public: template< class Iterator, class IteratorConnectHandler> - BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (error_code, Iterator)) + BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,void (error_code, Iterator)) async_connect( Iterator begin, Iterator end, IteratorConnectHandler&& handler); @@ -1165,8 +1161,7 @@ public: class Iterator, class ConnectCondition, class IteratorConnectHandler> - BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (error_code, Iterator)) + BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,void (error_code, Iterator)) async_connect( Iterator begin, Iterator end, ConnectCondition connect_condition, @@ -1286,8 +1281,7 @@ public: operation completes. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, - void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_some( MutableBufferSequence const& buffers, ReadHandler&& handler); @@ -1406,8 +1400,7 @@ public: operation completes. */ template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, - void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some( ConstBufferSequence const& buffers, WriteHandler&& handler); diff --git a/include/boost/beast/core/buffered_read_stream.hpp b/include/boost/beast/core/buffered_read_stream.hpp index 7dd23acd..f588f6e4 100644 --- a/include/boost/beast/core/buffered_read_stream.hpp +++ b/include/boost/beast/core/buffered_read_stream.hpp @@ -264,8 +264,7 @@ public: manner equivalent to using `net::post`. */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_some(MutableBufferSequence const& buffers, ReadHandler&& handler); @@ -341,8 +340,7 @@ public: manner equivalent to using `net::post`. */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some(ConstBufferSequence const& buffers, WriteHandler&& handler); }; diff --git a/include/boost/beast/core/detail/config.hpp b/include/boost/beast/core/detail/config.hpp index a3ef7f78..67c614af 100644 --- a/include/boost/beast/core/detail/config.hpp +++ b/include/boost/beast/core/detail/config.hpp @@ -83,4 +83,14 @@ namespace net = boost::asio; # define BOOST_BEAST_DECL #endif +#ifndef BOOST_BEAST_ASYNC_RESULT1 +#define BOOST_BEAST_ASYNC_RESULT1(type) \ + BOOST_ASIO_INITFN_RESULT_TYPE(type, void(::boost::beast::error_code)) +#endif + +#ifndef BOOST_BEAST_ASYNC_RESULT2 +#define BOOST_BEAST_ASYNC_RESULT2(type) \ + BOOST_ASIO_INITFN_RESULT_TYPE(type, void(::boost::beast::error_code, std::size_t)) +#endif + #endif diff --git a/include/boost/beast/core/detail/impl/read.hpp b/include/boost/beast/core/detail/impl/read.hpp index 74458ed2..2acee883 100644 --- a/include/boost/beast/core/detail/impl/read.hpp +++ b/include/boost/beast/core/detail/impl/read.hpp @@ -227,8 +227,7 @@ template< class CompletionCondition, class ReadHandler, class> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read( AsyncReadStream& stream, DynamicBuffer& buffer, diff --git a/include/boost/beast/core/detail/read.hpp b/include/boost/beast/core/detail/read.hpp index 6ff2198b..7d8d03cc 100644 --- a/include/boost/beast/core/detail/read.hpp +++ b/include/boost/beast/core/detail/read.hpp @@ -231,8 +231,7 @@ template< >::type #endif > -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read( AsyncReadStream& stream, DynamicBuffer& buffer, diff --git a/include/boost/beast/core/file.hpp b/include/boost/beast/core/file.hpp index bb1ed7bc..f0b530ae 100644 --- a/include/boost/beast/core/file.hpp +++ b/include/boost/beast/core/file.hpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com) +// Copyright (c) 2015-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/boost/beast/core/file_base.hpp b/include/boost/beast/core/file_base.hpp index 9229aa7a..e49c5194 100644 --- a/include/boost/beast/core/file_base.hpp +++ b/include/boost/beast/core/file_base.hpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com) +// Copyright (c) 2015-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/boost/beast/core/file_posix.hpp b/include/boost/beast/core/file_posix.hpp index 86e53523..313e0978 100644 --- a/include/boost/beast/core/file_posix.hpp +++ b/include/boost/beast/core/file_posix.hpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com) +// Copyright (c) 2015-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/boost/beast/core/file_stdio.hpp b/include/boost/beast/core/file_stdio.hpp index 860c1e5e..d56632b8 100644 --- a/include/boost/beast/core/file_stdio.hpp +++ b/include/boost/beast/core/file_stdio.hpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com) +// Copyright (c) 2015-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/boost/beast/core/file_win32.hpp b/include/boost/beast/core/file_win32.hpp index 4cdc312e..61246c43 100644 --- a/include/boost/beast/core/file_win32.hpp +++ b/include/boost/beast/core/file_win32.hpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com) +// Copyright (c) 2015-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/boost/beast/core/flat_stream.hpp b/include/boost/beast/core/flat_stream.hpp index 958e9265..288eaf2c 100644 --- a/include/boost/beast/core/flat_stream.hpp +++ b/include/boost/beast/core/flat_stream.hpp @@ -256,8 +256,7 @@ public: template< class MutableBufferSequence, class ReadHandler> - BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_some( MutableBufferSequence const& buffers, ReadHandler&& handler); @@ -338,8 +337,7 @@ public: template< class ConstBufferSequence, class WriteHandler> - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some( ConstBufferSequence const& buffers, WriteHandler&& handler); diff --git a/include/boost/beast/core/impl/basic_stream.hpp b/include/boost/beast/core/impl/basic_stream.hpp index 214907d5..0a1f3635 100644 --- a/include/boost/beast/core/impl/basic_stream.hpp +++ b/include/boost/beast/core/impl/basic_stream.hpp @@ -801,8 +801,7 @@ close() template template -BOOST_ASIO_INITFN_RESULT_TYPE(ConnectHandler, - void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(ConnectHandler) basic_stream:: async_connect( endpoint_type const& ep, @@ -822,8 +821,7 @@ template< class EndpointSequence, class RangeConnectHandler, class> -BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler, - void(error_code, typename Protocol::endpoint)) +BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void(error_code, typename Protocol::endpoint)) basic_stream:: async_connect( EndpointSequence const& endpoints, @@ -845,8 +843,7 @@ template< class ConnectCondition, class RangeConnectHandler, class> -BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler, - void (error_code, typename Protocol::endpoint)) +BOOST_ASIO_INITFN_RESULT_TYPE(RangeConnectHandler,void (error_code, typename Protocol::endpoint)) basic_stream:: async_connect( EndpointSequence const& endpoints, @@ -867,8 +864,7 @@ template template< class Iterator, class IteratorConnectHandler> -BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (error_code, Iterator)) +BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,void (error_code, Iterator)) basic_stream:: async_connect( Iterator begin, Iterator end, @@ -889,8 +885,7 @@ template< class Iterator, class ConnectCondition, class IteratorConnectHandler> -BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler, - void (error_code, Iterator)) +BOOST_ASIO_INITFN_RESULT_TYPE(IteratorConnectHandler,void (error_code, Iterator)) basic_stream:: async_connect( Iterator begin, Iterator end, @@ -911,8 +906,7 @@ async_connect( template template -BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, - void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) basic_stream:: async_read_some( MutableBufferSequence const& buffers, @@ -932,8 +926,7 @@ async_read_some( template template -BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, - void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) basic_stream:: async_write_some( ConstBufferSequence const& buffers, diff --git a/include/boost/beast/core/impl/buffered_read_stream.hpp b/include/boost/beast/core/impl/buffered_read_stream.hpp index 39380688..7a85cb04 100644 --- a/include/boost/beast/core/impl/buffered_read_stream.hpp +++ b/include/boost/beast/core/impl/buffered_read_stream.hpp @@ -142,8 +142,7 @@ buffered_read_stream(Args&&... args) template template -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) buffered_read_stream:: async_write_some( ConstBufferSequence const& buffers, @@ -214,8 +213,7 @@ read_some(MutableBufferSequence const& buffers, template template -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) buffered_read_stream:: async_read_some( MutableBufferSequence const& buffers, diff --git a/include/boost/beast/core/impl/file_posix.ipp b/include/boost/beast/core/impl/file_posix.ipp index 6d22503d..9b837d36 100644 --- a/include/boost/beast/core/impl/file_posix.ipp +++ b/include/boost/beast/core/impl/file_posix.ipp @@ -1,5 +1,5 @@ // -// Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com) +// Copyright (c) 2015-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/boost/beast/core/impl/file_stdio.ipp b/include/boost/beast/core/impl/file_stdio.ipp index 46897f9c..6fa078b6 100644 --- a/include/boost/beast/core/impl/file_stdio.ipp +++ b/include/boost/beast/core/impl/file_stdio.ipp @@ -1,5 +1,5 @@ // -// Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com) +// Copyright (c) 2015-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/boost/beast/core/impl/file_win32.ipp b/include/boost/beast/core/impl/file_win32.ipp index cd0939c1..8944a6bb 100644 --- a/include/boost/beast/core/impl/file_win32.ipp +++ b/include/boost/beast/core/impl/file_win32.ipp @@ -1,5 +1,5 @@ // -// Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com) +// Copyright (c) 2015-2019 Vinnie Falco (vinnie dot falco at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/include/boost/beast/core/impl/flat_stream.hpp b/include/boost/beast/core/impl/flat_stream.hpp index 10249053..575aa7ce 100644 --- a/include/boost/beast/core/impl/flat_stream.hpp +++ b/include/boost/beast/core/impl/flat_stream.hpp @@ -147,8 +147,7 @@ template template< class MutableBufferSequence, class ReadHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) flat_stream:: async_read_some( MutableBufferSequence const& buffers, @@ -229,8 +228,7 @@ template template< class ConstBufferSequence, class WriteHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) flat_stream:: async_write_some( ConstBufferSequence const& buffers, diff --git a/include/boost/beast/http/impl/file_body_win32.hpp b/include/boost/beast/http/impl/file_body_win32.hpp index 1bf65d08..385a4879 100644 --- a/include/boost/beast/http/impl/file_body_win32.hpp +++ b/include/boost/beast/http/impl/file_body_win32.hpp @@ -544,8 +544,7 @@ template< class Protocol, class Executor, bool isRequest, class Fields, class WriteHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some( net::basic_stream_socket< Protocol, Executor>& sock, diff --git a/include/boost/beast/http/impl/read.hpp b/include/boost/beast/http/impl/read.hpp index 1e49b292..51d2ea43 100644 --- a/include/boost/beast/http/impl/read.hpp +++ b/include/boost/beast/http/impl/read.hpp @@ -301,8 +301,7 @@ template< class DynamicBuffer, bool isRequest, class ReadHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_some( AsyncReadStream& stream, DynamicBuffer& buffer, @@ -371,8 +370,7 @@ template< class DynamicBuffer, bool isRequest, class ReadHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_header( AsyncReadStream& stream, DynamicBuffer& buffer, @@ -442,8 +440,7 @@ template< class DynamicBuffer, bool isRequest, class ReadHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read( AsyncReadStream& stream, DynamicBuffer& buffer, @@ -531,8 +528,7 @@ template< class DynamicBuffer, bool isRequest, class Body, class Allocator, class ReadHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read( AsyncReadStream& stream, DynamicBuffer& buffer, diff --git a/include/boost/beast/http/impl/write.hpp b/include/boost/beast/http/impl/write.hpp index b770af89..910dcac4 100644 --- a/include/boost/beast/http/impl/write.hpp +++ b/include/boost/beast/http/impl/write.hpp @@ -463,8 +463,7 @@ template< class AsyncWriteStream, bool isRequest, class Body, class Fields, class WriteHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some_impl( AsyncWriteStream& stream, serializer& sr, @@ -527,8 +526,7 @@ template< class AsyncWriteStream, bool isRequest, class Body, class Fields, class WriteHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some( AsyncWriteStream& stream, serializer& sr, @@ -610,8 +608,7 @@ template< class AsyncWriteStream, bool isRequest, class Body, class Fields, class WriteHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_header( AsyncWriteStream& stream, serializer& sr, @@ -684,8 +681,7 @@ template< class AsyncWriteStream, bool isRequest, class Body, class Fields, class WriteHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write( AsyncWriteStream& stream, serializer& sr, @@ -807,8 +803,7 @@ template< class WriteHandler> typename std::enable_if< is_mutable_body_writer::value, - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t))>::type + BOOST_BEAST_ASYNC_RESULT2(WriteHandler)>::type async_write( AsyncWriteStream& stream, message& msg, @@ -837,8 +832,7 @@ template< class WriteHandler> typename std::enable_if< ! is_mutable_body_writer::value, - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t))>::type + BOOST_BEAST_ASYNC_RESULT2(WriteHandler)>::type async_write( AsyncWriteStream& stream, message const& msg, diff --git a/include/boost/beast/http/read.hpp b/include/boost/beast/http/read.hpp index d8eef0bf..aa8d1285 100644 --- a/include/boost/beast/http/read.hpp +++ b/include/boost/beast/http/read.hpp @@ -207,8 +207,7 @@ template< class DynamicBuffer, bool isRequest, class ReadHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_some( AsyncReadStream& stream, DynamicBuffer& buffer, @@ -403,8 +402,7 @@ template< class DynamicBuffer, bool isRequest, class ReadHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_header( AsyncReadStream& stream, DynamicBuffer& buffer, @@ -599,8 +597,7 @@ template< class DynamicBuffer, bool isRequest, class ReadHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read( AsyncReadStream& stream, DynamicBuffer& buffer, @@ -804,8 +801,7 @@ template< class DynamicBuffer, bool isRequest, class Body, class Allocator, class ReadHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read( AsyncReadStream& stream, DynamicBuffer& buffer, diff --git a/include/boost/beast/http/write.hpp b/include/boost/beast/http/write.hpp index a5bebad7..05962161 100644 --- a/include/boost/beast/http/write.hpp +++ b/include/boost/beast/http/write.hpp @@ -172,8 +172,7 @@ template< class AsyncWriteStream, bool isRequest, class Body, class Fields, class WriteHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some( AsyncWriteStream& stream, serializer& sr, @@ -301,8 +300,7 @@ template< class AsyncWriteStream, bool isRequest, class Body, class Fields, class WriteHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_header( AsyncWriteStream& stream, serializer& sr, @@ -421,8 +419,7 @@ template< class AsyncWriteStream, bool isRequest, class Body, class Fields, class WriteHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write( AsyncWriteStream& stream, serializer& sr, @@ -646,13 +643,11 @@ template< bool isRequest, class Body, class Fields, class WriteHandler> #if BOOST_BEAST_DOXYGEN -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) #else typename std::enable_if< is_mutable_body_writer::value, - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t))>::type + BOOST_BEAST_ASYNC_RESULT2(WriteHandler)>::type #endif async_write( AsyncWriteStream& stream, @@ -709,13 +704,11 @@ template< bool isRequest, class Body, class Fields, class WriteHandler> #if BOOST_BEAST_DOXYGEN -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) #else typename std::enable_if< ! is_mutable_body_writer::value, - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t))>::type + BOOST_BEAST_ASYNC_RESULT2(WriteHandler)>::type #endif async_write( AsyncWriteStream& stream, diff --git a/include/boost/beast/version.hpp b/include/boost/beast/version.hpp index d69a19c9..f6b1132b 100644 --- a/include/boost/beast/version.hpp +++ b/include/boost/beast/version.hpp @@ -13,7 +13,7 @@ #include #include -/** @def BOOST_BEAST_API_VERSION +/* BOOST_BEAST_VERSION Identifies the API version of Beast. diff --git a/include/boost/beast/websocket/impl/accept.hpp b/include/boost/beast/websocket/impl/accept.hpp index ddf32a40..fb1c33f4 100644 --- a/include/boost/beast/websocket/impl/accept.hpp +++ b/include/boost/beast/websocket/impl/accept.hpp @@ -545,8 +545,7 @@ accept( template template< class AcceptHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) stream:: async_accept( AcceptHandler&& handler) @@ -568,8 +567,7 @@ template template< class ResponseDecorator, class AcceptHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) stream:: async_accept_ex( ResponseDecorator const& decorator, @@ -597,8 +595,7 @@ template< class AcceptHandler> typename std::enable_if< ! http::detail::is_header::value, - BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code))>::type + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)>::type stream:: async_accept( ConstBufferSequence const& buffers, @@ -627,8 +624,7 @@ template< class AcceptHandler> typename std::enable_if< ! http::detail::is_header::value, - BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code))>::type + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)>::type stream:: async_accept_ex( ConstBufferSequence const& buffers, @@ -658,8 +654,7 @@ template template< class Body, class Allocator, class AcceptHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) stream:: async_accept( http::request> const& req, @@ -683,8 +678,7 @@ template< class Body, class Allocator, class ResponseDecorator, class AcceptHandler> -BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) stream:: async_accept_ex( http::request> const& req, diff --git a/include/boost/beast/websocket/impl/close.hpp b/include/boost/beast/websocket/impl/close.hpp index 42cf2f97..0df879f3 100644 --- a/include/boost/beast/websocket/impl/close.hpp +++ b/include/boost/beast/websocket/impl/close.hpp @@ -381,8 +381,7 @@ close(close_reason const& cr, error_code& ec) template template -BOOST_ASIO_INITFN_RESULT_TYPE( - CloseHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(CloseHandler) stream:: async_close(close_reason const& cr, CloseHandler&& handler) { diff --git a/include/boost/beast/websocket/impl/handshake.hpp b/include/boost/beast/websocket/impl/handshake.hpp index 0cc33a9b..0ccb1102 100644 --- a/include/boost/beast/websocket/impl/handshake.hpp +++ b/include/boost/beast/websocket/impl/handshake.hpp @@ -267,8 +267,7 @@ do_handshake( template template -BOOST_ASIO_INITFN_RESULT_TYPE( - HandshakeHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) stream:: async_handshake( string_view host, @@ -293,8 +292,7 @@ async_handshake( template template -BOOST_ASIO_INITFN_RESULT_TYPE( - HandshakeHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) stream:: async_handshake( response_type& res, @@ -470,8 +468,7 @@ handshake_ex(response_type& res, template template -BOOST_ASIO_INITFN_RESULT_TYPE( - HandshakeHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) stream:: async_handshake_ex(string_view host, string_view target, @@ -503,8 +500,7 @@ async_handshake_ex(string_view host, template template -BOOST_ASIO_INITFN_RESULT_TYPE( - HandshakeHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) stream:: async_handshake_ex(response_type& res, string_view host, diff --git a/include/boost/beast/websocket/impl/ping.hpp b/include/boost/beast/websocket/impl/ping.hpp index 822af88c..35a314c7 100644 --- a/include/boost/beast/websocket/impl/ping.hpp +++ b/include/boost/beast/websocket/impl/ping.hpp @@ -286,8 +286,7 @@ pong(ping_data const& payload, error_code& ec) template template -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(WriteHandler) stream:: async_ping(ping_data const& payload, WriteHandler&& handler) { @@ -305,8 +304,7 @@ async_ping(ping_data const& payload, WriteHandler&& handler) template template -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code)) +BOOST_BEAST_ASYNC_RESULT1(WriteHandler) stream:: async_pong(ping_data const& payload, WriteHandler&& handler) { diff --git a/include/boost/beast/websocket/impl/read.hpp b/include/boost/beast/websocket/impl/read.hpp index 101983c8..dac24146 100644 --- a/include/boost/beast/websocket/impl/read.hpp +++ b/include/boost/beast/websocket/impl/read.hpp @@ -795,8 +795,7 @@ read(DynamicBuffer& buffer, error_code& ec) template template -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) stream:: async_read(DynamicBuffer& buffer, ReadHandler&& handler) { @@ -870,8 +869,7 @@ read_some( template template -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) stream:: async_read_some( DynamicBuffer& buffer, @@ -1254,8 +1252,7 @@ loop: template template -BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(ReadHandler) stream:: async_read_some( MutableBufferSequence const& buffers, diff --git a/include/boost/beast/websocket/impl/write.hpp b/include/boost/beast/websocket/impl/write.hpp index 11aa4218..2da69efb 100644 --- a/include/boost/beast/websocket/impl/write.hpp +++ b/include/boost/beast/websocket/impl/write.hpp @@ -698,8 +698,7 @@ write_some(bool fin, template template -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) stream:: async_write_some(bool fin, ConstBufferSequence const& bs, WriteHandler&& handler) @@ -755,8 +754,7 @@ write(ConstBufferSequence const& buffers, error_code& ec) template template -BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) +BOOST_BEAST_ASYNC_RESULT2(WriteHandler) stream:: async_write( ConstBufferSequence const& bs, WriteHandler&& handler) diff --git a/include/boost/beast/websocket/stream.hpp b/include/boost/beast/websocket/stream.hpp index f386376b..b13fdbe0 100644 --- a/include/boost/beast/websocket/stream.hpp +++ b/include/boost/beast/websocket/stream.hpp @@ -877,8 +877,7 @@ public: @li origin-form (RFC7230) */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - HandshakeHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) async_handshake( string_view host, string_view target, @@ -961,8 +960,7 @@ public: @li origin-form (RFC7230) */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - HandshakeHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) async_handshake( response_type& res, string_view host, @@ -1283,8 +1281,7 @@ public: @li Websocket Opening Handshake Server Requirements (RFC6455) */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) async_accept(AcceptHandler&& handler); /** Perform the WebSocket handshake asynchronously in the server role. @@ -1354,8 +1351,7 @@ public: #else typename std::enable_if< ! http::detail::is_header::value, - BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code))>::type + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)>::type #endif async_accept( ConstBufferSequence const& buffers, @@ -1413,8 +1409,7 @@ public: template< class Body, class Allocator, class AcceptHandler> - BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) async_accept( http::request> const& req, @@ -1546,8 +1541,7 @@ public: @li Websocket Closing Handshake (RFC6455) */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - CloseHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(CloseHandler) async_close(close_reason const& cr, CloseHandler&& handler); //-------------------------------------------------------------------------- @@ -1644,8 +1638,7 @@ public: manner equivalent to using `net::post`. */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(WriteHandler) async_ping(ping_data const& payload, WriteHandler&& handler); /** Send a websocket pong control frame. @@ -1748,8 +1741,7 @@ public: manner equivalent to using `net::post`. */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(WriteHandler) async_pong(ping_data const& payload, WriteHandler&& handler); //-------------------------------------------------------------------------- @@ -1905,8 +1897,7 @@ public: manner equivalent to using `net::post`. */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read( DynamicBuffer& buffer, ReadHandler&& handler); @@ -2081,8 +2072,7 @@ public: manner equivalent to using `net::post`. */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_some( DynamicBuffer& buffer, std::size_t limit, @@ -2253,8 +2243,7 @@ public: manner equivalent to using `net::post`. */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - ReadHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_some( MutableBufferSequence const& buffers, ReadHandler&& handler); @@ -2375,8 +2364,7 @@ public: template< class ConstBufferSequence, class WriteHandler> - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write( ConstBufferSequence const& buffers, WriteHandler&& handler); @@ -2495,8 +2483,7 @@ public: manner equivalent to using `net::post`. */ template - BOOST_ASIO_INITFN_RESULT_TYPE( - WriteHandler, void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some(bool fin, ConstBufferSequence const& buffers, WriteHandler&& handler); @@ -2538,8 +2525,7 @@ public: error_code& ec); template - BOOST_ASIO_INITFN_RESULT_TYPE( - HandshakeHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) async_handshake_ex( string_view host, string_view target, @@ -2547,8 +2533,7 @@ public: HandshakeHandler&& handler); template - BOOST_ASIO_INITFN_RESULT_TYPE( - HandshakeHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) async_handshake_ex( response_type& res, string_view host, @@ -2600,8 +2585,7 @@ public: template< class ResponseDecorator, class AcceptHandler> - BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) async_accept_ex( ResponseDecorator const& decorator, AcceptHandler&& handler); @@ -2612,8 +2596,7 @@ public: class AcceptHandler> typename std::enable_if< ! http::detail::is_header::value, - BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code))>::type + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler)>::type async_accept_ex( ConstBufferSequence const& buffers, ResponseDecorator const& decorator, @@ -2623,8 +2606,7 @@ public: class Body, class Allocator, class ResponseDecorator, class AcceptHandler> - BOOST_ASIO_INITFN_RESULT_TYPE( - AcceptHandler, void(error_code)) + BOOST_BEAST_ASYNC_RESULT1(AcceptHandler) async_accept_ex( http::request> const& req, diff --git a/test/beast/core/async_base.cpp b/test/beast/core/async_base.cpp index bfd7ba61..a8f5e976 100644 --- a/test/beast/core/async_base.cpp +++ b/test/beast/core/async_base.cpp @@ -581,7 +581,7 @@ public: // Asynchronously read into a buffer until the buffer is full, or an error occurs template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (error_code, std::size_t)) + typename net::async_result::return_type async_read(AsyncReadStream& stream, net::mutable_buffer buffer, ReadHandler&& handler) { using handler_type = BOOST_ASIO_HANDLER_TYPE(ReadHandler, void(error_code, std::size_t)); diff --git a/test/doc/core_4_layers.cpp b/test/doc/core_4_layers.cpp index dc7018d0..06cbfeea 100644 --- a/test/doc/core_4_layers.cpp +++ b/test/doc/core_4_layers.cpp @@ -244,8 +244,7 @@ public: /// Read some data from the stream asynchronously template - BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, - void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(ReadHandler) async_read_some( MutableBufferSequence const& buffers, ReadHandler&& handler) @@ -261,8 +260,7 @@ public: /// Write some data to the stream asynchronously template - BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, - void(error_code, std::size_t)) + BOOST_BEAST_ASYNC_RESULT2(WriteHandler) async_write_some( ConstBufferSequence const& buffers, WriteHandler&& handler)