mirror of
https://github.com/boostorg/beast.git
synced 2025-08-03 14:54:32 +02:00
Tidying and fixes
This commit is contained in:
@@ -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__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__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">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>
|
<member><link linkend="beast.ref.boost__beast__websocket__reason_string">reason_string</link></member>
|
||||||
</simplelist>
|
</simplelist>
|
||||||
<bridgehead renderas="sect3">Functions</bridgehead>
|
<bridgehead renderas="sect3">Functions</bridgehead>
|
||||||
@@ -292,6 +293,8 @@
|
|||||||
<bridgehead renderas="sect3">Options</bridgehead>
|
<bridgehead renderas="sect3">Options</bridgehead>
|
||||||
<simplelist type="vert" columns="1">
|
<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__permessage_deflate">permessage_deflate</link></member>
|
||||||
|
<member><link linkend="beast.ref.boost__beast__websocket__stream_base.suggested_settings">suggested_settings</link> <emphasis role="green">🞲</emphasis></member>
|
||||||
|
<member><link linkend="beast.ref.boost__beast__websocket__stream_base__timeout">timeout</link> <emphasis role="green">🞲</emphasis></member>
|
||||||
</simplelist>
|
</simplelist>
|
||||||
<bridgehead renderas="sect3">Constants</bridgehead>
|
<bridgehead renderas="sect3">Constants</bridgehead>
|
||||||
<simplelist type="vert" columns="1">
|
<simplelist type="vert" columns="1">
|
||||||
|
@@ -62,7 +62,7 @@ namespace test {
|
|||||||
To facilitate testing, these streams support some additional
|
To facilitate testing, these streams support some additional
|
||||||
features:
|
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
|
may be directly accessed by the caller to inspect the contents
|
||||||
before or after the remote endpoint writes data. This allows
|
before or after the remote endpoint writes data. This allows
|
||||||
a unit test to verify that the received data matches.
|
a unit test to verify that the received data matches.
|
||||||
|
@@ -26,6 +26,8 @@ namespace test {
|
|||||||
I/O context, until one of the following conditions is true:
|
I/O context, until one of the following conditions is true:
|
||||||
|
|
||||||
@li The I/O context runs out of work.
|
@li The I/O context runs out of work.
|
||||||
|
|
||||||
|
@param ioc The I/O context to run
|
||||||
*/
|
*/
|
||||||
inline
|
inline
|
||||||
void
|
void
|
||||||
@@ -44,6 +46,8 @@ run(net::io_context& ioc)
|
|||||||
|
|
||||||
@li No completions occur and the specified amount of time has elapsed.
|
@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.
|
@param elapsed The maximum amount of time to run for.
|
||||||
*/
|
*/
|
||||||
template<class Rep, class Period>
|
template<class Rep, class Period>
|
||||||
|
@@ -110,7 +110,7 @@ public:
|
|||||||
|
|
||||||
@par Example
|
@par Example
|
||||||
This function reads a line of text from a stream into a
|
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
|
@code
|
||||||
template <class SyncReadStream>
|
template <class SyncReadStream>
|
||||||
std::size_t read_line (SyncReadStream& stream, flat_buffer& buffer)
|
std::size_t read_line (SyncReadStream& stream, flat_buffer& buffer)
|
||||||
|
@@ -38,10 +38,10 @@ namespace http {
|
|||||||
fields.
|
fields.
|
||||||
The parser is optimized for the case where the input buffer
|
The parser is optimized for the case where the input buffer
|
||||||
sequence consists of a single contiguous buffer. The
|
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
|
that the input sequence of the stream buffer will be represented
|
||||||
by exactly one contiguous buffer. To ensure the optimum performance
|
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.
|
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
|
Alternatively, the caller may use custom techniques to ensure that
|
||||||
the structured portion of the HTTP message (header or chunk header)
|
the structured portion of the HTTP message (header or chunk header)
|
||||||
@@ -511,7 +511,7 @@ public:
|
|||||||
@b ConstBufferSequence that represents the next chunk of
|
@b ConstBufferSequence that represents the next chunk of
|
||||||
message data. If the length of this buffer sequence is
|
message data. If the length of this buffer sequence is
|
||||||
one, the implementation will not allocate additional memory.
|
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
|
meet this requirement
|
||||||
|
|
||||||
@param ec Set to the error, if any occurred.
|
@param ec Set to the error, if any occurred.
|
||||||
|
@@ -93,22 +93,21 @@ struct stream<NextLayer, deflateSupported>::impl_type
|
|||||||
saved_handler op_r_close; // paused close op (async read)
|
saved_handler op_r_close; // paused close op (async read)
|
||||||
|
|
||||||
bool secure_prng_ = true;
|
bool secure_prng_ = true;
|
||||||
|
|
||||||
bool ec_delivered = false;
|
bool ec_delivered = false;
|
||||||
bool timed_out = false;
|
bool timed_out = false;
|
||||||
int idle_counter = 0;
|
int idle_counter = 0;
|
||||||
|
|
||||||
// settings
|
|
||||||
|
|
||||||
timeout timeout_opt;
|
timeout timeout_opt;
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
template<class... Args>
|
template<class... Args>
|
||||||
impl_type(Args&&... args)
|
impl_type(Args&&... args)
|
||||||
: stream(std::forward<Args>(args)...)
|
: stream(std::forward<Args>(args)...)
|
||||||
, timer(stream.get_executor().context())
|
, timer(stream.get_executor().context())
|
||||||
{
|
{
|
||||||
|
timeout_opt.handshake_timeout = none();
|
||||||
|
timeout_opt.idle_timeout = none();
|
||||||
|
timeout_opt.keep_alive_pings = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -64,11 +64,11 @@ struct stream_base
|
|||||||
amount of time, the operation will be canceled and a
|
amount of time, the operation will be canceled and a
|
||||||
timeout error delivered to the completion handler.
|
timeout error delivered to the completion handler.
|
||||||
*/
|
*/
|
||||||
duration handshake_timeout = none();
|
duration handshake_timeout;
|
||||||
|
|
||||||
/** The time limit after which a connection is considered idle.
|
/** The time limit after which a connection is considered idle.
|
||||||
*/
|
*/
|
||||||
duration idle_timeout = none();
|
duration idle_timeout;
|
||||||
|
|
||||||
/** Automatic ping setting.
|
/** Automatic ping setting.
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ struct stream_base
|
|||||||
An outstanding read operation must be pending, which will
|
An outstanding read operation must be pending, which will
|
||||||
complete immediately the error @ref beast::error::timeout.
|
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.
|
/** Construct timeout settings with suggested values for a role.
|
||||||
@@ -103,7 +103,7 @@ struct stream_base
|
|||||||
timeout
|
timeout
|
||||||
suggested_settings(role_type role) noexcept
|
suggested_settings(role_type role) noexcept
|
||||||
{
|
{
|
||||||
timeout opt;
|
timeout opt{};
|
||||||
switch(role)
|
switch(role)
|
||||||
{
|
{
|
||||||
case role_type::client:
|
case role_type::client:
|
||||||
|
Reference in New Issue
Block a user