...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This version fixes significant defects in websocket::stream
which can lead to asserts or
undefined behavior. Users are encouraged to update to the latest Boost release.
New Features
bool
template parameter to websocket::stream
When deflateSupported
is true
, the stream will be
capable of negotiating the permessage-deflate websocket extension per the
configured run-time settings. When deflateSupported
is false
, the stream will
never negotiate the permessage-deflate websocket extension. Furthermore,
all of the code necessary for implementing the permessage-deflate extension
will be excluded from function instantiations. Programs which set deflateSupported
to false
when instantiating streams will be smaller.
websocket::error::failed
and websocket::error::handshake_failed
are removed. Actions required: Code which explicitly compares error_code
values against the constant
websocket::error::handshake_failed
should compare against
websocket::condition::handshake_failed
instead. Code
which explicitly compares error_code values against the constant websocket::error::failed
should compare against websocket::condition::protocol_violation
instead.
Improvements
http::basic_fields
uses less storage
http::basic_fields
exception specifiers
are provided
asio::null_buffers
<boost/beast/websocket/stream_fwd.hpp>
bind_handler
works with boost placeholders
reuse_address(true)
Fixes
ssl_stream
special members in example/common/ssl_stream.hpp
<algorithm>
are protected from macros
http::basic_fields::erase
bind_handler
doc
"ws_.wr_block_ == tok_"
.
API Changes
handler_ptr
. Actions required:
don't call non-public members.
handler_ptr
is a move-only type, with unique_ptr
semantics. Actions required: user-defined composed operations using handler_ptr
to manage state can only
be moved, not copied.
handler_ptr
gives the strong exception guarantee. The constructor signature for managed
objects constructed by handler_ptr
now receives a const
reference
to the handler. Actions required: Change the constructor signature for
state objects used with handler_ptr
to receive a const
reference
to the handler.
http::basic_fields
does not support
fancy pointers
http::parser
is no longer MoveConstructible
http::serializer::reader_impl
is deprecated and will be
removed in the next release. Actions required: Call http::serializer::writer_impl
instead of serializer::reader_impl
.
http::header
and value_type
objects. This enables the composition of body types. The previous single-argument
constructors are deprecated and will be removed in the next version. Actions
required: Change user-defined instances of BodyReader or BodyWriter constructor signatures to the
two-argument form. Alternatively. define the macro BOOST_BEAST_ALLOW_DEPRECATED
in the project (which will cause both the new and the deprecated signatures
to be accepted).
websocket::stream::control_callback
now copies or
moves the function object.
get_lowest_layer
is now a type alias. Actions required: Replace instances of typename get_lowest_layer<T>::type
with get_lowest_layer<T>
.