- Use a regular function pointer for dynamic dispatch.
- Remove `prng::ref` - it did not benefit the default case
(TLS avaialable) and actually made the no-TLS case slower, because
the time spent in the generator is dominated by mutex locking.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
The result of `g()` is a random number, therefore it's not necessary
to care about endianness in this case.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
close#1570
`std::launder` must be used whenever placement-new of an unknown type
is performed and the result of the placement-new expression is discarded.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
- don't assume layout or size overhead of classes with
virtual members (use split vtable)
- don't use SOO for types with throwing move
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This changes the interface used to apply a decorator to the HTTP
request or response messages used to perform the WebSocket handshake
as follows:
* Add the `stream_base::decorator` option object
* Add `stream::set_option` overload to set the decorator from
the option
* The decorator applies to all client and server handshakes
performed on the stream after the option is set.
* 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
Actions Required:
* Code which passes decorator to any `websocket::stream` member
function should call `stream::set_option` instead with a newly
constructed `stream_base::decorator` object containing the
decorator. Alternatively, the macro `BOOST_BEAST_ALLOW_DEPRECATED`
may be defined to 1.
fix#1416
* Calls to buffer_copy are qualified as net::buffer_copy
* Calls to buffer_size are made unqualified, permitting
argument dependent lookup to take effect.
This I/O object wraps an ordinary socket and provides a built-in
timeout and optional bandwidth rate-limiting facility.
Added class template basic_stream_socket
* Meets the requirements of AsyncReadStream and AsyncWriteStream
* Partially supports P1322R0:
"Networking TS enhancement to enable custom I/O executors"
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1322r0.html
A strand or other io_context-compatible executor may be
chosen to use for all asynchronous stream operations.
* Supports independent timeouts on logical operations:
connect, read, write, or both read and write.
* Provides an option for a configurable rate limit
limit on the maximum rates of reading or writing.
* The previous experimental implementation,
`timeout_socket` and related types, is removed.
* stream_socket is an alias for basic_stream_socket which
uses `net::ip::tcp` as its protocol.
* Tidy up and comment asserts
* `pausation` is renamed to saved_handler
* A work guard on the handler's associated executor
is maintained for the lifetime of the store handler.
fix#1279, close#1319
This enables users to improve compilation performance by explicitly
instantiating the stream template in another TU.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>