Tidying and fixes

This commit is contained in:
Vinnie Falco
2019-02-16 18:35:22 -08:00
parent fc7b47fc5d
commit 79c777e776
7 changed files with 19 additions and 13 deletions

View File

@@ -280,6 +280,7 @@
<member><link linkend="beast.ref.boost__beast__websocket__close_reason">close_reason</link></member>
<member><link linkend="beast.ref.boost__beast__websocket__ping_data">ping_data</link></member>
<member><link linkend="beast.ref.boost__beast__websocket__stream">stream</link></member>
<member><link linkend="beast.ref.boost__beast__websocket__stream_base">stream_base</link></member>
<member><link linkend="beast.ref.boost__beast__websocket__reason_string">reason_string</link></member>
</simplelist>
<bridgehead renderas="sect3">Functions</bridgehead>
@@ -292,6 +293,8 @@
<bridgehead renderas="sect3">Options</bridgehead>
<simplelist type="vert" columns="1">
<member><link linkend="beast.ref.boost__beast__websocket__permessage_deflate">permessage_deflate</link></member>
<member><link linkend="beast.ref.boost__beast__websocket__stream_base.suggested_settings">suggested_settings</link>&nbsp;<emphasis role="green">&#128946;</emphasis></member>
<member><link linkend="beast.ref.boost__beast__websocket__stream_base__timeout">timeout</link>&nbsp;<emphasis role="green">&#128946;</emphasis></member>
</simplelist>
<bridgehead renderas="sect3">Constants</bridgehead>
<simplelist type="vert" columns="1">

View File

@@ -62,7 +62,7 @@ namespace test {
To facilitate testing, these streams support some additional
features:
@li The input area, represented by a @ref basic_flat_buffer,
@li The input area, represented by a @ref beast::basic_flat_buffer,
may be directly accessed by the caller to inspect the contents
before or after the remote endpoint writes data. This allows
a unit test to verify that the received data matches.

View File

@@ -26,6 +26,8 @@ namespace test {
I/O context, until one of the following conditions is true:
@li The I/O context runs out of work.
@param ioc The I/O context to run
*/
inline
void
@@ -44,6 +46,8 @@ run(net::io_context& ioc)
@li No completions occur and the specified amount of time has elapsed.
@param ioc The I/O context to run
@param elapsed The maximum amount of time to run for.
*/
template<class Rep, class Period>

View File

@@ -110,7 +110,7 @@ public:
@par Example
This function reads a line of text from a stream into a
@ref basic_flat_buffer, using the net function `async_read_until`.
@ref beast::basic_flat_buffer, using the net function `async_read_until`.
@code
template <class SyncReadStream>
std::size_t read_line (SyncReadStream& stream, flat_buffer& buffer)

View File

@@ -38,10 +38,10 @@ namespace http {
fields.
The parser is optimized for the case where the input buffer
sequence consists of a single contiguous buffer. The
@ref basic_flat_buffer class is provided, which guarantees
@ref beast::basic_flat_buffer class is provided, which guarantees
that the input sequence of the stream buffer will be represented
by exactly one contiguous buffer. To ensure the optimum performance
of the parser, use @ref basic_flat_buffer with HTTP algorithms
of the parser, use @ref beast::basic_flat_buffer with HTTP algorithms
such as @ref read, @ref read_some, @ref async_read, and @ref async_read_some.
Alternatively, the caller may use custom techniques to ensure that
the structured portion of the HTTP message (header or chunk header)
@@ -511,7 +511,7 @@ public:
@b 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 @ref beast::flat_buffer is provided as one way to
The class @ref beast::basic_flat_buffer is provided as one way to
meet this requirement
@param ec Set to the error, if any occurred.

View File

@@ -93,22 +93,21 @@ struct stream<NextLayer, deflateSupported>::impl_type
saved_handler op_r_close; // paused close op (async read)
bool secure_prng_ = true;
bool ec_delivered = false;
bool timed_out = false;
int idle_counter = 0;
// settings
timeout timeout_opt;
//
template<class... Args>
impl_type(Args&&... args)
: stream(std::forward<Args>(args)...)
, timer(stream.get_executor().context())
{
timeout_opt.handshake_timeout = none();
timeout_opt.idle_timeout = none();
timeout_opt.keep_alive_pings = false;
}
void

View File

@@ -64,11 +64,11 @@ struct stream_base
amount of time, the operation will be canceled and a
timeout error delivered to the completion handler.
*/
duration handshake_timeout = none();
duration handshake_timeout;
/** The time limit after which a connection is considered idle.
*/
duration idle_timeout = none();
duration idle_timeout;
/** Automatic ping setting.
@@ -86,7 +86,7 @@ struct stream_base
An outstanding read operation must be pending, which will
complete immediately the error @ref beast::error::timeout.
*/
bool keep_alive_pings = false;
bool keep_alive_pings;
};
/** Construct timeout settings with suggested values for a role.
@@ -103,7 +103,7 @@ struct stream_base
timeout
suggested_settings(role_type role) noexcept
{
timeout opt;
timeout opt{};
switch(role)
{
case role_type::client: