...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Write a buffer sequence to the parser.
template< class ConstBufferSequence> std::size_t put( ConstBufferSequence const& buffers, error_code& ec);
This function attempts to incrementally parse the HTTP message data stored in the caller provided buffers. Upon success, a positive return value indicates that the parser made forward progress, consuming that number of bytes.
In some cases there may be an insufficient number of octets in the input
buffer in order to make forward progress. This is indicated by the code
http::need_more
.
When this happens, the caller should place additional bytes into the buffer
sequence and call http::basic_parser::put
again.
The error code http::need_more
is special. When this
error is returned, a subsequent call to http::basic_parser::put
may succeed if the buffers
have been updated. Otherwise, upon error the parser may not be restarted.
Name |
Description |
---|---|
|
An object meeting the requirements of ConstBufferSequence that
represents the next chunk of message data. If the length of this
buffer sequence is one, the implementation will not allocate
additional memory. The class |
|
Set to the error, if any occurred. |
The number of octets consumed in the buffer sequence. The caller should remove these octets even if the error is set.