| Home | Libraries | People | FAQ | More

## Release Notes

#### Boost 1.70

| Tip
The namespace alias `net` is used throughout for `boost::asio`.

New Features

- All composed operations use the new `net::async_initiate` internally.
- New `tcp_stream` and `basic_stream` support:
  - Timeouts, `async_read_some`, `async_write_some` complete with `error::timeout` on expiration.
  - Traffic-shaping policies `simple` and `unlimited`, or a user-defined RatePolicy.
  - Supports P1322R0.
- `websocket::stream` supports
  - Configurable handshake timeout
  - Configurable idle timeout
  - Automatic idle pings
- `ssl_stream` is a public interface
- ( #1305) Better `flat_buffer`, `flat_static_buffer`, `multi_buffer`, and `static_buffer`:
  - Revise all reference documentation
  - Move construction does not always invalidate buffers
  - non-const `data()` returns a mutable buffer sequence
  - Add `cdata()` to also return constant readable bytes
  - Eligible member functions are declared `noexcept`
- ( #1345) Better `flat_buffer`, `multi_buffer`
  - Add `clear`, `reserve()`, `max_size()`, `shrink_to_fit()`
  - Respect Allocator `max_size()`
  - Specify exception safety
- ( #1384) New functions `bind_front_handler`
- Better `static_buffer`, `flat_static_buffer`
  - Add `clear()`
  - More members are `noexcept`
  - Specify exception safety
- Faster `http::string_to_field`
- Dynamic buffer `clear` operations perserve capacity.
- New file <boost/beast/core/buffer_traits.hpp>
  - New variadic `is_const_buffer_sequence`
  - New variadic `is_mutable_buffer_sequence`
  - New trait `buffers_iterator_type`
  - New trait `buffers_type`
- New classes `async_base`, `stable_async_base`
  - Handle boilerplate for writing composed operations
  - New `allocate_stable` is preferred over `handler_ptr`
- New `buffer_bytes` replacement for `net::buffer_size`
- New:
  - `saved_handler`
  - `buffers_range_ref`
  - `dynamic_buffer_ref`
  - `executor_type`
  - `get_lowest_layer`, `lowest_layer_type`
  - `close_socket`, `beast_close_socket`
  - `error`, `condition`
- These interfaces are now public (were experimental): `flat_stream`, `detect_ssl`, `async_detect_ssl`.
- Websocket streams use PCG as the fast random number generator, for increased security.

Documentation

- WebSocket reference documentation is revised
- Updated Networking Refresher
- Revised Asynchronous Echo
- Rewritten Detect SSL Handshake

API Changes

- The Fields concept is deprecated and will be removed in a future version. Actions Required: Do not rely on the Fields concept.
- `handler_ptr` is deprecated. Actions Required: Use `stable_async_base` and `allocate_stable` instead.
- On Windows, Visual Studio 2017 or later is required
- OpenSSL is required to build the examples and tests
- HTTP stream algorithms return the number of bytes transferred from the stream. Previously, they returned the number of bytes consumed by the parser. Actions Required:
  - Callers depending on the return value of `http::read` or `http::async_read` overloads should adjust the usage of the returned value as needed.
- Metafunctions `has_get_executor`, `is_sync_stream`, `is_sync_read_stream`, `is_sync_write_stream`, `is_async_stream`, `is_async_read_stream`, and `is_async_write_stream` are in stream_traits.hpp. Actions Required: Include stream_traits.hpp as needed.
- `basic_parser` is abstract. Actions Required
  - Change uses of the `basic_parser` type to omit the `Derived` template parameter
  - Classes derived from `basic_parser` no longer need to friend the base.
  - Virtual functions in the derived class may be marked `override`.
- Metafunction `is_file` is in file_base.hpp. Actions Required: Include file_base.hpp as needed.
- `flat_static_buffer::reset()` is deprecated. Actions Required:
  - call `clear()` instead.
- `buffers_adapter` is spelled `buffers_adaptor`. Actions Required:
  - Replace `buffers_adapter` with `buffers_adaptor`, or define `BOOST_BEAST_ALLOW_DEPRECATED`.
- `buffers` is spelled `make_printable`. Actions Required:
  - Replace `buffers` with `make_printable`, and include "make_printable.hpp" instead of "ostream.hpp".
- `file_mode::append_new` is removed, as it makes no sense. Actions Required: - Replace `file_mode::append_new` with either `file_mode::append` or `file_mode::append_existing` as needed.
- `role_type` is moved from `websocket` to `beast`
- `buffers_range_ref` is preferred to `std::reference_wrapper`. Actions Required: - Call `buffers_range_ref` with the buffer, instead of calling `buffers_range` with a reference wrapper constructed from the buffer.
- Nested `lowest_layer` and `lowest_layer_type` are removed. Actions Required: Use the free function `get_lowest_layer` and the type trait `lowest_layer_type` instead.
- WebSocket decorator is a socket option:
  - Overloads of the following functions which accept a Decorator are deprecated: - `accept`, `accept_ex` - `handshake`, `handshake_ex` - `async_accept`, `async_accept_ex` - `async_handshake`, `async_handshake_ex`

Examples

- All example programs are updated:
  - Use `tcp_stream` with timeouts (HTTP)
  - Use `ssl_stream`
  - Set timeouts for WebSocket streams.
  - Use `bind_front_handler`
- ( #1100) http-crawl clears the response before each read
- ( #1347) echo-op is rewritten
- ( #1401) Examples use `flat_buffer`
- Advanced servers use HTTP parser interfaces for reading
- detect-ssl is rewritten
- New example example/websocket/server/chat-multi
- `async_echo` works with move-only handlers
- cppcon2018 example is removed

Fixes

- ( #38) Better treatment of SSL short reads
- ( #1223) HTTP read counts bytes correctly when an error occurs
- ( #1247) Update `ssl_stream` for Asio changes
- ( #1279) Enable explicit instantiations of `websocket::stream`
- ( #1290) Don't use deprecated Asio interfaces
- ( #1306) `http::message` is not-a `boost::empty_value`
- ( #1306) `test::stream` has fewer dependencies
- ( #1358) Destroy abandoned websocket ops on shutdown
- ( #1365) Handler wrappers decay parameters sooner
- ( #1408) `session_alloc` is thread-safe
- ( #1414) Boost.System is header-only
- ( #1418) `test::stream` maintains a handler work guard
- ( #1445) Fix posix_file::close handling of EINTR
- ( #1460) Large WebSocket Upgrade response no longer overflows
- Reusing an HTTP parser returns an error
- Handler bind wrappers use the associated allocator
- `buffers_cat` correctly skips empty buffers when iterated
- `ostream` does not overflow or exceed the dynamic buffer's maximum size
- Fixes to `test::stream::async_read`
- `file_mode::append_existing` works correctly
- A handler work guard is maintained on paused websocket operations
- All behavior of default-constructed iterators is conforming

#### Boost 1.69

New Videos

New Features

- ( #1133) Add `BOOST_BEAST_USE_STD_STRING_VIEW`

Examples

- New WebSocket server and browser-based client: example/cppcon2018

Fixes

- ( #1245) Fix a rare case of incorrect UTF8 validation
- ( #1237) Verify certificates in client examples
- ( #1233) Use `boost::empty_value`
- ( #1091) Fix timer on websocket upgrade in examples
- ( #1270) `basic_fields` uses intrusive base hooks
- ( #1267) Fix parsing of out-of-bounds hex values
- ( #1263) Fix uninitialized comparison in buffers iterator
- ( #1288) Remove extraneous strand from example
- Workaround for http-server-fast and libstdc++
- Partial support for `BOOST_NO_EXCEPTIONS`

Experimental

- Add `timeout_socket`

#### Boost 1.68

This version fixes a missing executor work guard in all composed operations used in the implementation. Users who are experiencing crashes related to asynchronous completion handlers are encouraged to upgrade. Also included is an improved mechanism for generating random numbers used to mask outgoing websocket frames when operating in the client mode. This resolves a vulnerability described in the Beast Hybrid Assessment Report from Bishop Fox.

New Features

The include directory `<beast/experimental>` contains features which are not part of the stable public interface but are available anyway. They may change in future versions.

- ( #1108) New `flat_stream` for working around an SSL stream performance limitation
- ( #1151, #595) New `http::icy_stream` stream filter allows parsing ICY HTTP response handshakes
- New `ssl_stream` for better SSL performance and move constructability
- New `test::connect`, `test::error`, `test::fail_count`, and `test::stream` utilities for writing unit tests.
- New `http::is_mutable_body_writer` metafunction
- New `websocket::seed_prng` for manually providing entropy to the PRNG
- New `websocket::stream::secure_prng` to control whether the connection uses a secure PRNG

Improvements

- Generated WebSocket masks use a secure PRNG by default
- Improvements to `buffers_adaptor`
- ( #1188) Set "/permissive-" for MSVC builds
- ( #1109) Use a shared string for example HTTP server doc roots
- ( #1079) Add `handler_ptr::has_value`

Fixes

- ( #1073) Fix race in advanced server examples
- ( #1076) Use executor_work_guard in composed operations
- ( #1079) Remove spurious assert
- ( #1113) Add `const` and non-`const` overloads for message based HTTP writes
- ( #1119) Fix unused variable warning
- ( #1121) Examples use the root certificate which matches the fingerprint
- ( #1141) Tidy up composed operation doc
- ( #1186) Check error in example set_option
- ( #1210) Fix http_server_stackless_ssl.cpp example
- ( #1211) Fix parse_dec algorithm
- ( #1214) Silence ubsan false positive
- Tidy up websocket stream javadocs
- Fix move-only arguments in `bind_handler`
- Fix `http::parser` constructor javadoc
- Fix `buffers_adaptor` iterator value type
- Fix `buffers_adaptor::max_size`
- Fix `buffers_prefix` iterator decrement
- Fix Fields, FieldsWriter concept docs
- Fix BodyReader constructor requirements doc

Breaking Changes

- Remove deprecated `serializer::reader_impl`
- Remove deprecated Body `reader` and `writer` ctor signatures

#### Boost 1.67

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

- Move-only completion handlers are supported throughout the library
- ( #899) Advanced server examples support idle websocket pings and timeouts
- ( #849) WebSocket permessage-deflate support is now a compile-time feature. This adds an additional `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.
- ( #949) WebSocket error codes are revised. New error codes are added for more fine-grained failure outcomes. Messages for error codes are more verbose to help pinpoint the problem. Error codes are now also mapped to newly added error conditions to simplify comparisons. The error codes `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

- ( #857) `http::basic_fields` uses less storage
- ( #894) `http::basic_fields` exception specifiers are provided
- Implementation no longer uses deprecated `asio::null_buffers`
- Add `<boost/beast/websocket/stream_fwd.hpp>`
- ( #955) The asynchronous SSL detector example uses a stackless coroutine
- `bind_handler` works with boost placeholders
- Examples set `reuse_address(true)`
- ( #1026) Advanced servers support clean shutdown via SIGINT or SIGTERM
- Some basic_fields operations now give the strong exception guarantee

Fixes

- Fix "warning: ‘const’ type qualifier on return type has no effect"
- ( #916) Tidy up `ssl_stream` special members
- ( #918) Calls to `<algorithm>` are protected from macros
- ( #954) The control callback is invoked on the proper executor
- ( #994) Fix iterator version of `http::basic_fields::erase`
- ( #992) Fix use-after-move in example request handlers
- ( #988) Type check completion handlers
- ( #985) Tidy up `bind_handler` doc
- Fix memory leak in advanced server examples
- ( #1000) Fix soft-mutex assert in websocket stream. This resolves the assert `"ws_.wr_block_ == tok_"`.
- ( #1019) Fix fallthrough warnings
- ( #1024) Fix teardown for TIME_WAIT
- ( #1030) Fix big-endian websocket masking
- Safe treatment of zero-length string arguments in basic_fields
- ( #1043) Examples clear the HTTP message before reading
- ( #1012) Add asio_handler_invoke overloads for stream algorithms
- Add Access-Control-Expose-Headers field constant

API Changes

- Remove unintended public members of `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.
- ( #896) `http::basic_fields` does not support fancy pointers
- `http::parser` is no longer MoveConstructible
- ( #930) `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`.
- ( #884) The BodyReader and BodyWriter concept constructor requirements have changed. They now require the header and body elements to be passed as distinct `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.
- ( #1014) DynamicBuffer input areas are not mutable. Actions required: do not attempt to write to input areas of dynamic buffers.
- ( #941) `get_lowest_layer` is now a type alias. Actions required: Replace instances of `typename get_lowest_layer<T>::type` with `get_lowest_layer<T>`.

#### Boost 1.66

- Initial release