diff --git a/CHANGELOG.md b/CHANGELOG.md index 43818148..69ce2e0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ * Use beast::string_view alias +HTTP + +* Tidy up basic_parser javadocs + WebSocket: * Add websocket async echo ssl server test: diff --git a/include/beast/http/basic_parser.hpp b/include/beast/http/basic_parser.hpp index d2ea5677..0cda49d3 100644 --- a/include/beast/http/basic_parser.hpp +++ b/include/beast/http/basic_parser.hpp @@ -509,12 +509,15 @@ public: /** Returns a set of buffers for storing body data. - @note This member function is only available when - `isDirect==true`. + @param buffers A writable output parameter into which + the function will place the buffers upon success. @param limit The maximum number of bytes in the size of the returned buffer sequence. The actual size of the buffer sequence may be lower than this number. + + @note This member function is only available when + `isDirect==true`. */ template void @@ -523,6 +526,10 @@ public: /** Commit body data. + @param n The number of bytes to commit. This must + be less than or equal to the size of the buffer + sequence returned by @ref prepare_body. + @note This member function is only available when `isDirect==true`. */ @@ -530,6 +537,8 @@ public: commit_body(std::size_t n); /** Indicate that body octets have been consumed. + + @param n The number of bytes to consume. */ void consume(std::size_t n) @@ -548,16 +557,6 @@ public: } } - /** Consume all remaining body data. - - This function instructs the parser to advance the - state past any expected body octets. Callers who - wish to read and process the body themselves will - call this function. - */ - void - consume_body(error_code& ec); - private: inline Derived& diff --git a/include/beast/http/impl/basic_parser.ipp b/include/beast/http/impl/basic_parser.ipp index 0070ebed..f34a0e82 100644 --- a/include/beast/http/impl/basic_parser.ipp +++ b/include/beast/http/impl/basic_parser.ipp @@ -230,34 +230,6 @@ commit_body(std::size_t n) } } -template -void -basic_parser:: -consume_body(error_code& ec) -{ - BOOST_ASSERT( - state_ == parse_state::body || - state_ == parse_state::body_to_eof || - state_ == parse_state::chunk_body); - switch(state_) - { - case parse_state::body: - case parse_state::body_to_eof: - do_complete(ec); - if(ec) - return; - break; - - case parse_state::chunk_body: - len_ = 0; - state_ = parse_state::chunk_header; - break; - - default: - break; - } -} - template template inline