diff --git a/CHANGELOG b/CHANGELOG index b223e8a3..18cf19df 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ 1.0.0-b6 +* Add HTTP field value parsers * Use SFINAE on return values * Use beast::error_code instead of nested types +* Tidy up use of GENERATING_DOCS -------------------------------------------------------------------------------- diff --git a/TODO.txt b/TODO.txt index 00cb1054..31043032 100644 --- a/TODO.txt +++ b/TODO.txt @@ -7,11 +7,7 @@ Boost.Http Docs: * Include Example program listings in the docs * Fix index in docs -* Figure out why namespace rfc2616 is included in docs - (currently disabled via GENERATING_DOCS macro) * melpon sandbox? -* Check DOXYGEN, GENERATIC_DOCS directives in source - - See if we can include them now that xsl is fixed * Implement cleanup-param to remove spaces around template arguments e.g. in basic_streambuf move constructor members * Don't put using namespace at file scope in examples, @@ -23,15 +19,12 @@ Core: * Complete allocator testing in basic_streambuf WebSocket: +* more invokable unit test coverage +* More control over the HTTP request and response during handshakes * optimized versions of key/masking, choose prepared_key size -* invokable unit test -* Don't try to read requests into empty_body * Give callers control over the http request/response used during handshake * Investigate poor autobahn results in Debug builds * Fall through composed operation switch cases -* Replace stream::error_ with stream::state_, example states: ok, error, abort_io - Need a cancel state so waking up a ping stored in invokable knows to call the - final handler with operation_aborted * Use close_code::no_code instead of close_code::none * Make request_type, response_type public APIs, use in stream member function signatures @@ -56,8 +49,5 @@ HTTP: * Complete allocator testing in basic_streambuf, basic_headers * Add tests for writer using the resume function / coros * Custom HTTP error codes for various situations -* Make empty_body write-only, remove reader nested type -* Add concepts WritableBody ReadableBody with type checks, - check them in read and write functions * Branch prediction hints in parser * Check basic_parser_v1 against rfc7230 for leading message whitespace diff --git a/examples/http_stream.hpp b/examples/http_stream.hpp index 4bf275d2..eb07f637 100644 --- a/examples/http_stream.hpp +++ b/examples/http_stream.hpp @@ -321,12 +321,12 @@ public: */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< ReadHandler, void(error_code)>::result_type - #endif +#endif async_read(message_v1& msg, ReadHandler&& handler); @@ -416,12 +416,12 @@ public: */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< WriteHandler, void(error_code)>::result_type - #endif +#endif async_write(message_v1 const& msg, WriteHandler&& handler); diff --git a/include/beast/core/static_string.hpp b/include/beast/core/static_string.hpp index 911abcce..a3ec8919 100644 --- a/include/beast/core/static_string.hpp +++ b/include/beast/core/static_string.hpp @@ -506,8 +506,6 @@ compare( } // detail -#if ! GENERATING_DOCS - template bool operator==( @@ -672,8 +670,6 @@ operator>=( return detail::compare(lhs, s) >= 0; } -#endif - } // beast #endif diff --git a/include/beast/http/basic_parser_v1.hpp b/include/beast/http/basic_parser_v1.hpp index cdfd5026..c0acbf39 100644 --- a/include/beast/http/basic_parser_v1.hpp +++ b/include/beast/http/basic_parser_v1.hpp @@ -373,14 +373,14 @@ public: @return The number of bytes consumed in the input sequence. */ template - #if GENERATING_DOCS +#if GENERATING_DOCS std::size_t - #else +#else typename std::enable_if< ! std::is_convertible::value, std::size_t>::type - #endif +#endif write(ConstBufferSequence const& buffers, error_code& ec); /** Write a single buffer of data to the parser. diff --git a/include/beast/http/message.hpp b/include/beast/http/message.hpp index 1be051c0..04c77037 100644 --- a/include/beast/http/message.hpp +++ b/include/beast/http/message.hpp @@ -145,8 +145,6 @@ private: } }; -#if ! GENERATING_DOCS - /// A typical HTTP request template>> @@ -157,8 +155,6 @@ template>> using response = message; -#endif - } // http } // beast diff --git a/include/beast/http/message_v1.hpp b/include/beast/http/message_v1.hpp index cb25ac2f..fb700b81 100644 --- a/include/beast/http/message_v1.hpp +++ b/include/beast/http/message_v1.hpp @@ -50,8 +50,6 @@ struct message_v1 : message } }; -#if ! GENERATING_DOCS - /// A typical HTTP/1 request template>> @@ -62,8 +60,6 @@ template>> using response_v1 = message_v1; -#endif - /// Returns `true` if a HTTP/1 message indicates a keep alive template bool diff --git a/include/beast/websocket/stream.hpp b/include/beast/websocket/stream.hpp index 7ee2b160..83699916 100644 --- a/include/beast/websocket/stream.hpp +++ b/include/beast/websocket/stream.hpp @@ -95,12 +95,12 @@ public: /// The type of the lowest layer. using lowest_layer_type = -#if GENERATING_DOCS + #if GENERATING_DOCS implementation_defined; -#else + #else typename beast::detail::get_lowest_layer< next_layer_type>::type; -#endif + #endif /** Move-construct a stream. @@ -404,12 +404,12 @@ public: manner equivalent to using `boost::asio::io_service::post`. */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< AcceptHandler, void(error_code)>::result_type - #endif +#endif async_accept(AcceptHandler&& handler); /** Read and respond to a WebSocket HTTP Upgrade request. @@ -530,12 +530,12 @@ public: manner equivalent to using `boost::asio::io_service::post`. */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< AcceptHandler, void(error_code)>::result_type - #endif +#endif async_accept(ConstBufferSequence const& buffers, AcceptHandler&& handler); @@ -647,12 +647,12 @@ public: manner equivalent to using `boost::asio::io_service::post`. */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< AcceptHandler, void(error_code)>::result_type - #endif +#endif async_accept(http::request_v1 const& request, AcceptHandler&& handler); @@ -784,12 +784,12 @@ public: manner equivalent to using `boost::asio::io_service::post`. */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< HandshakeHandler, void(error_code)>::result_type - #endif +#endif async_handshake(boost::string_ref const& host, boost::string_ref const& resource, HandshakeHandler&& h); @@ -895,12 +895,12 @@ public: manner equivalent to using `boost::asio::io_service::post`. */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< CloseHandler, void(error_code)>::result_type - #endif +#endif async_close(close_reason const& cr, CloseHandler&& handler); /** Send a WebSocket ping frame. @@ -973,12 +973,12 @@ public: manner equivalent to using `boost::asio::io_service::post`. */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< PingHandler, void(error_code)>::result_type - #endif +#endif async_ping(ping_data const& payload, PingHandler&& handler); /** Read a message from the stream. @@ -1103,12 +1103,12 @@ public: manner equivalent to using `boost::asio::io_service::post`. */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< ReadHandler, void(error_code)>::result_type - #endif +#endif async_read(opcode& op, Streambuf& streambuf, ReadHandler&& handler); @@ -1243,12 +1243,12 @@ public: manner equivalent to using boost::asio::io_service::post(). */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< ReadHandler, void(error_code)>::result_type - #endif +#endif async_read_frame(frame_info& fi, Streambuf& streambuf, ReadHandler&& handler); @@ -1369,12 +1369,12 @@ public: manner equivalent to using `boost::asio::io_service::post`. */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< WriteHandler, void(error_code)>::result_type - #endif +#endif async_write(ConstBufferSequence const& buffers, WriteHandler&& handler); @@ -1478,12 +1478,12 @@ public: ); @endcode */ template - #if GENERATING_DOCS +#if GENERATING_DOCS void_or_deduced - #else +#else typename async_completion< WriteHandler, void(error_code)>::result_type - #endif +#endif async_write_frame(bool fin, ConstBufferSequence const& buffers, WriteHandler&& handler);