208 Commits

Author SHA1 Message Date
Vinnie Falco c0695db877 Merge master into develop 2018-11-26 15:26:51 -08:00
Vinnie Falco cf6021a355 Fix broken doc link 2018-11-26 12:04:03 -08:00
Vinnie Falco d581bcc348 Add bind_front_handler:
This works similarly to bind_handler, and can help with reducing
template instantiations and compiler memory usage (since it does
not need to support placeholders).

A specialization for the most common case `void(error_code, size_t)`
is provided to minimize instantiation cost.
2018-11-21 12:47:38 -08:00
Vinnie Falco 071cab92d5 Add buffers_range 2018-11-12 06:39:36 -08:00
Vinnie Falco bc2f5f1426 Add CppCon2018 chat server example and video 2018-11-08 16:46:38 -08:00
Vinnie Falco 04bac8dce9 Remove extraneous strand from example
fix #1288
2018-11-03 19:30:16 -07:00
Vinnie Falco 65434a0cba Partial support for BOOST_NO_EXCEPTIONS:
Some stream operations are modified to use a
helper function which supports BOOST_NO_EXCEPTIONS.
2018-11-01 21:10:54 -07:00
Vinnie Falco 30ca9c59d3 Fix uninitialized comparison in buffers iterator
fix #1263
2018-11-01 21:10:54 -07:00
Vinnie Falco ef0658f678 Add experimental timeout_socket:
This is a socket wrapper which has a built-in timeout feature on
reads and writes.
2018-10-28 19:43:28 -07:00
compmaniak 955b7b31a5 Fix parsing of out-of-bounds hex values
fix #1267
2018-10-20 08:40:27 -07:00
Vinnie Falco 29e9ad5370 basic_fields uses intrusive base hooks:
fix #1270

basic_fields::value_type uses base hooks instead of member hooks,
otherwise MSVC can sometimes produce undefined behavior when
attempting to recover the base class from a data member in
certain build configurations.
2018-10-19 17:42:30 -07:00
jarle 2b977f2770 Fix timer on websocket upgrade in examples
fix #1091, fix #1240, fix #1253
2018-10-07 10:38:36 -07:00
Domen Vrankar 806979e37b Add BOOST_BEAST_USE_STD_STRING_VIEW:
fix #1133, fix #1241

When the macro BOOST_BEAST_USE_STD_STRING_VIEW is defined,
Beast will use std::string_view instead of boost::string_view.

The name boost::beast::string_view is a type alias for the
chosen view type.
2018-10-07 10:38:36 -07:00
luz.paz f3212eba48 Fix some typos:
fix #1255

Found via `codespell -q 3 -L uint,te,tim --skip="./test/extern/zlib*,./example/http/client/crawl*"`
2018-10-07 10:35:12 -07:00
Vinnie Falco 82e87ea188 Workaround for http-server-fast and libstdc++:
This fixes a problem where libstdc++ incorrectly assumes that the
allocator used with basic_string is DefaultConstructible.

See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56437
2018-09-23 19:08:30 -07:00
Glen Fernandes 5e98c78951 Use boost::empty_value
fix #1233
2018-09-23 10:12:08 -07:00
PeterW3 4643b0565e Verify certificates in client examples:
fix #1237

HTTP client examples now verify the server's certificate
and generate an error if the certificate is invalid or
expired:

* Set certificate verify mode
* Remove duplicate root certificate
2018-09-23 10:12:08 -07:00
Boris Sergeev a4c008907d Fix a rare case of incorrect UTF8 validation
fix #1245, fix #1249

The value used to fill the incomplete code point buffer is
changed to a character which no longer causes
utf8_checker::valid() to incorrectly return false.
2018-09-23 10:12:07 -07:00
Vinnie Falco f32a8e2c99 Silence ubsan false positive
fix #1214
2018-08-02 07:20:47 -07:00
compmaniak 802390886d Fix parse_dec algorithm
fix #1211
2018-07-29 17:05:11 -07:00
felixguendling ba4bdfed71 Fix http_server_stackless_ssl.cpp example
fix #1210

Write to self_.stream_ instead of the socket_ directly
2018-07-28 07:00:51 -07:00
Vinnie Falco dd6dff92ab Typo in release notes 2018-07-15 08:32:52 -07:00
Vinnie Falco e9e5d159c6 Set version to 177 2018-07-12 11:10:00 -07:00
Vinnie Falco 749e54f31b Generated WebSocket masks use a secure PRNG by default:
This resolves a medium vulnerability described in the
Beast Hybrid Assessment Report by Bishop Fox, where masks generated
for use with outgoing WebSocket client frames use an insufficient
source of entropy and a non-cryptographically secure pseudo-random
number generator.

By default, all newly constructed WebSocket streams will use a
uniquely seeded secure PRNG (ChaCha20 in counter mode). As this may
result in increased CPU resource consumption, the function
websocket::stream::secure_prng() may be used to select a faster but
less secure PRNG, for the case where the caller knows that the secure
generator is not necessary.

On some systems, std::random_device may produce insufficient entropy
to securely seed the PRNG. As this condition cannot be detected by
Beast, callers may use the function websocket::seed_prng() called
once at startup to provide at least 256 bits of entropy which will
be used to uniquely seed all subsequent PRNGs.
2018-07-08 15:20:05 -07:00
Vinnie Falco 20eb6af42d Tidy up Quick Reference 2018-07-04 14:35:59 -07:00
Vinnie Falco e97d70d329 Update Release Notes 2018-06-29 10:05:55 -07:00
Vinnie Falco 436f6f96b1 Fix BodyReader constructor requirements doc 2018-06-18 11:09:50 -07:00
Vinnie Falco 37c90220d0 Fix Fields, FieldsWriter concept docs 2018-06-18 08:42:24 -07:00
Vinnie Falco 6647e9ea56 Add experimental icy_stream Shoutcast stream filter:
fix #595, fix #1151

This provides a stream filter which converts the ICY HTTP
response handshake at the beginning of a stream to HTTP/1.1.
2018-06-09 21:12:01 -07:00
Vinnie Falco c9298f6522 Remove Autobahn testsuite doc note 2018-05-31 06:27:00 -07:00
Vinnie Falco 5b1022d63e Tidy up composed operation doc
fix #1141
2018-05-29 15:33:55 -07:00
Vinnie Falco f5def127d8 Tidy up test::stream javadocs 2018-05-29 15:32:01 -07:00
Vinnie Falco 07aead170a Add is_mutable_body_writer metafunction 2018-05-04 19:34:05 -07:00
Vinnie Falco 73bc28aaa2 Remove deprecated serializer::reader_impl() 2018-05-03 19:42:36 -07:00
Vinnie Falco a94efc8c92 Add test::stream to experimental 2018-05-02 08:32:09 -07:00
Vinnie Falco e4c2ae6384 Add test::fail_count to experimental 2018-05-02 08:32:09 -07:00
Vinnie Falco 292801fef7 Add ssl_stream to experimental:
The ssl_stream wrapper provides C++11 move semantics for ssl::stream,
as well as incorporating the flat_stream workaround for a performance
problem with ssl::stream writes and buffer sequences having length
greater than one.
2018-05-02 08:32:09 -07:00
Vinnie Falco 6108cf3eb7 Add flat_stream to experimental:
This adds a new stream wrapper class template designed to address
a performance shortcoming of boost::asio::ssl::stream.
2018-05-02 08:32:07 -07:00
Vinnie Falco c9a445a937 New flat_stream example class:
fix #1108

The `flat_stream` is a stream wrapper designed to overcome a
performance limitation of the `boost::asio::ssl::stream`
implementation. Specifically, when writing buffer sequences having
length greater than one, the `ssl::stream` implementation does
not use scatter-gather I/O and instead performs a kernel transition
for every buffer in the sequence.

The wrapper addresses this problem by allocating memory and
presenting the buffer sequence into a single buffer, using
some logic to determine when this allocation is advantageous
versus simply passing the buffers through as-is.

See Also:
https://github.com/boostorg/asio/issues/100
https://stackoverflow.com/questions/50026167/performance-drop-on-port-from-beast-1-0-0-b66-to-boost-1-67-0-beast
2018-04-30 19:49:42 -07:00
Vinnie Falco 86342dd72b Use executor_work_guard in composed operations:
fix #1076

As per Asio and Networking TS requirements, composed operations must
maintain an object of type executor_work_guard for the executor associated
with the I/O object, for the lifetime of the asynchronous operation.

This is in addition to the requirement for maintaining an object of type
executor_work_guard for the executor associated with the handler.
2018-04-10 08:03:04 -07:00
Ivan Vilata-i-Balaguer edd162cf3b Add Access-Control-Expose-Headers field constant:
This response header is described both in [CORS](https://www.w3.org/TR/cors/)
and [Fetch](https://fetch.spec.whatwg.org/) specifications.
2018-03-09 09:29:14 -08:00
Vinnie Falco 726118468b Add asio_handler_invoke overloads for stream algorithms:
fix #1012

This fixes a bug where asynchronous stream alogrithms do not
work correctly with the legacy `io_service::strand` implementation.
2018-03-01 08:31:57 -08:00
Vinnie Falco 04ced3b954 Examples clear the HTTP message before reading
fix #1043
2018-02-27 08:12:54 -08:00
Vinnie Falco 5d5e58c5b4 Some basic_fields operations now give the strong exception guarantee 2018-02-26 17:09:47 -08:00
Vinnie Falco 9f094518bc Safe treatment of zero-length string arguments in basic_fields:
This fixes a broken memcpy precondition when empty strings are
passed as arguments to basic_fields member functions.
2018-02-26 17:09:20 -08:00
Vinnie Falco a8a5fa9f6c Fix typo in release notes 2018-02-26 17:09:01 -08:00
Vinnie Falco eae74b1c89 get_lowest_layer is a type alias:
fix #941, fix #1016

`get_lowest_layer` is now a type alias for the
lowest layer instead of a struct with a nested type.

Actions required:

* Replace instances of `typename get_lowest_layer<T>::type`
  with `get_lowest_layer<T>`.
2018-02-21 14:49:44 -08:00
Vinnie Falco 66f0814cfd Tidy up some documentation
fix #984
2018-02-21 13:58:43 -08:00
Vinnie Falco d79950d95c DynamicBuffer input areas are not mutable
fix #1014
2018-02-21 13:19:14 -08:00
Vinnie Falco 10ce0283c2 Advanced servers support clean shutdown via SIGINT or SIGTERM
fix #1026
2018-02-21 12:44:11 -08:00