Commit Graph

1313 Commits

Author SHA1 Message Date
Damian Jarek
d40255b357 Use lean_tuple in buffers_cat
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-21 12:47:38 -08:00
Damian Jarek
b97169f26b Add detail::lean_tuple
Provides a subset of std::tuple functionality, for internal use
to reduce the resources required during compilation.

Does not support reference-like semantics on assignment.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-21 12:47:38 -08:00
Damian Jarek
65827558b8 Simplify some type traits:
Several type traits are simplified and optimized to
reduce compile time and memory consumption.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-21 12:47:38 -08:00
Vinnie Falco
15dd535c24 Use bind_front_handler:
The implementation uses bind_front_handler to reduce the
resources consumed when instantiating templates during
compilation.
2018-11-21 12:47:38 -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
d4c5dc2747
Set version to 190 2018-11-20 20:51:51 -08:00
Damian Jarek
5ade2a5050 Tidying:
fix #1311, fix #1310, fix #1309

* Remove unused include directive
* Remove redundant static_assert
* Remove redundant use of bind_handler

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-20 18:07:35 -08:00
Vinnie Falco
c18f3f0ef1 Rename to _experimental directory 2018-11-12 06:52:39 -08:00
Vinnie Falco
071cab92d5 Add buffers_range 2018-11-12 06:39:36 -08:00
Vinnie Falco
450964b78f Squashed 'doc/docca/' changes from 1bfc5ede..df9bd956
df9bd956 Add deduced alias
220ded9a Add see-below alias

git-subtree-dir: doc/docca
git-subtree-split: df9bd956e2480467447c80ffae3b44b3c0b0756a
2018-11-11 22:25:56 -08:00
Vinnie Falco
0f3696f2ec Unit test framework is experimental 2018-11-11 13:56:05 -08:00
Vinnie Falco
f997a63204 Add missing includes to convenience headers 2018-11-09 13:47:36 -08:00
Vinnie Falco
1ca690db06
Set version to 189 2018-11-08 16:46:46 -08:00
Vinnie Falco
e7e3fdb808
Set version to 188 2018-11-03 19:30:21 -07:00
Damian Jarek
1cdc1e3181 Add missing include in http/read.ipp
Fixes a compilation error that occurred when using
BOOST_ASIO_SEPARATE_COMPILATION.

Resolves: #1286

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-03 19:30:15 -07:00
Vinnie Falco
8962588cec Fix a spurious gcc warning 2018-11-03 18:43:21 -07:00
Vinnie Falco
8fc9b85795
Set version to 187 2018-11-01 21:11:12 -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
335f5c2333 Add detail::dynamic_buffer_prepare:
This function acts as a bottleneck for handling
exceptions thrown by dynamic buffers.
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
Vinnie Falco
f4c3e52a8c
Set version to 186 2018-10-20 08:40:31 -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
Vinnie Falco
ec1c8ada7a
Set version to 185 2018-10-07 18:35:53 -07:00
Vinnie Falco
a44e5f45e9
Set version to 184 2018-10-07 10:55:14 -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
e2d192ec78 Remove extraneous function 2018-10-07 10:35:12 -07:00
Vinnie Falco
65022367bb
Set version to 183 2018-09-23 19:08:34 -07:00
Glen Fernandes
5e98c78951 Use boost::empty_value
fix #1233
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
f2c3b5dec1
Set version to 182 2018-09-18 09:10:47 -07:00
Vinnie Falco
3f6190e015 Add missing includes 2018-09-18 09:10:42 -07:00
Vinnie Falco
f32a8e2c99 Silence ubsan false positive
fix #1214
2018-08-02 07:20:47 -07:00
Vinnie Falco
1da229a27c
Set version to 181 2018-07-29 17:39:12 -07:00
compmaniak
802390886d Fix parse_dec algorithm
fix #1211
2018-07-29 17:05:11 -07:00
Vinnie Falco
28f03be5b7
Set version to 180 2018-07-28 07:01:28 -07:00
Vinnie Falco
e23ecc8ac9
Set version to 179 2018-07-23 10:37:21 -07:00
Daniela Engert
e0f4c1d769 Most members of std::allocate are deprecated in C++17:
fix #1202

Replace them by their cousins from std::allocator_traits;
otherwise, heaps of deprecation warnings will fall onto
humble users when compiling with MSVC 15 in C++17 mode.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2018-07-23 09:19:46 -07:00
Glen Fernandes
8ed039200d Use the exchange() idiom in move constructors
fix #1203
2018-07-23 09:19:16 -07:00
Vinnie Falco
c4d1bfe7af
Set version to 178 2018-07-15 09:13:08 -07:00
Vinnie Falco
92d34b9e3b Use static_cast instead
fix #1163
2018-07-15 09:11:15 -07:00
Vinnie Falco
e9e5d159c6
Set version to 177 2018-07-12 11:10:00 -07:00
Vinnie Falco
e73b33f2bf
Set version to 176 2018-07-08 15:20:10 -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
68727b3cfb Fix array end calculation in utf8 assertion 2018-07-04 14:40:06 -07:00
Vinnie Falco
1a008faf0a
Set version to 175 2018-07-03 10:16:52 -07:00
Vinnie Falco
b7cc754b2a
Set version to 174 2018-06-29 10:06:17 -07:00
Vinnie Falco
37c90220d0 Fix Fields, FieldsWriter concept docs 2018-06-18 08:42:24 -07:00
Vinnie Falco
93c35524a6
Set version to 173 2018-06-09 21:12:09 -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
39b014263a buffers_adapter improvements:
* Add value()
* Add value_type
* Add in-place constructor
2018-06-09 21:10:25 -07:00
Vinnie Falco
2c5ed4595a Fix buffers_prefix iterator decrement 2018-06-09 13:01:30 -07:00
Vinnie Falco
bd3079f5b4 Fix buffers_adapter max_size 2018-06-09 13:01:30 -07:00
Vinnie Falco
da9bb07d12 Fix buffers_adapter iterator value type 2018-06-08 14:01:17 -07:00
Vinnie Falco
34e78cb900
Set version to 172 2018-05-30 17:05:34 -07:00
Vinnie Falco
f5def127d8 Tidy up test::stream javadocs 2018-05-29 15:32:01 -07:00
Vinnie Falco
5b8eb1d87d Fix http::parser constructor javadoc 2018-05-28 11:23:37 -07:00
Vinnie Falco
f948c9cbe5 Fix move-only arguments in bind_handler 2018-05-27 19:05:43 -07:00
Benjamin Buch
3d7f1e7303 Tidy up websocket stream javadocs:
Make clear text()/binary() option is different from got_text()/got_binary().
2018-05-19 07:54:27 -07:00
Vinnie Falco
ce2c63ac7a
Set version to 171 2018-05-18 17:26:15 -07:00
Vinnie Falco
0afb380f50 Fix unused variable warning
fix #1119
2018-05-18 17:25:56 -07:00
Vinnie Falco
6ea66fd89e Remove spurious assert
fix #1099
2018-05-18 17:25:56 -07:00
Damian Jarek
86555b90ae Add handler_ptr::has_value
This function returns `true` if the container holds a managed object.

Resolves: #1079

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-05-18 17:25:56 -07:00
Vinnie Falco
344d957f42
Set version to 170 2018-05-08 14:08:41 -07:00
Vinnie Falco
24bbda7b0d Add const and non-const overloads for message based http writes:
fix #1113

This solves a problem where the message-oriented synchronous
HTTP write algorithms do not support messages whose body
writer requires a non-const reference to the message in
order to construct.

In addition, the message-oriented async_write algorithm is
modified to support messages passed by const reference when
possible, based on the body writer attributes.
2018-05-06 19:57:25 -07:00
Vinnie Falco
07aead170a Add is_mutable_body_writer metafunction 2018-05-04 19:34:05 -07:00
Vinnie Falco
416f84bc63 Remove deprecated Body reader and writer ctor signatures 2018-05-04 12:47:27 -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
59f01a158b Add test::error 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
46e658a91b
Set version to 169 2018-04-30 19:49:46 -07:00
Vinnie Falco
dcfd07f6f2 Use fully qualified namespace in BOOST_BEAST_HANDLER_INIT 2018-04-28 11:14:39 -07:00
Vinnie Falco
c592782a1b Simplify some type trait expressions
fix #466
2018-04-26 17:30:46 -07:00
Vinnie Falco
42ac536f9b Refactor HTTP write_op implementation
fix #764
2018-04-25 14:07:19 -07:00
Vinnie Falco
c5d4f8eede Use boost::void_t
fix #905
2018-04-24 15:14:37 -07:00
Vinnie Falco
14392d7f52 Use buffers_to_string in tests
fix #782
2018-04-24 10:55:39 -07:00
Vinnie Falco
5abac8b380
Set version to 168 2018-04-23 17:09:17 -07:00
Vinnie Falco
3c3f4fc52b Revert "Tidy up a warning"
This reverts commit 90d2df3be3.
2018-04-10 09:09:49 -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
Vinnie Falco
b4cb4f1fd3
Set version to 167 2018-03-22 20:14:16 -07:00
Vinnie Falco
12cc10f8bb Revert "Tidy up calls to post()"
This reverts commit 5eaa2be85e.
2018-03-22 20:13:39 -07:00
Vinnie Falco
4d660a5e54
Set version to 166 2018-03-13 10:47:19 -07:00
Vinnie Falco
4b0c14fe5a Use boost::is_convertible as a workaround 2018-03-13 10:47:07 -07:00
Vinnie Falco
a03687eaa3
Set version to 165 2018-03-11 14:31:13 -07:00
Vinnie Falco
90d2df3be3 Tidy up a warning 2018-03-11 14:22:50 -07:00
Daniel James
dabc1c8ae6 Fix BOOST_NO_CXX11_ALLOCATOR check 2018-03-11 14:22:31 -07:00
Vinnie Falco
6a34afb38a
Set version to 164 2018-03-09 09:29:18 -08: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
c984f6c94d Fix masking on continuation frames 2018-03-09 07:51:33 -08:00
Vinnie Falco
6d560e3d41
Set version to 163 2018-03-04 15:13:40 -08:00
Daniela Engert
a7b78ac1bc fix narrowing warnings
Signed-off-by: Daniela Engert <dani@ngrt.de>
2018-03-04 15:13:32 -08:00
Vinnie Falco
5eaa2be85e Tidy up calls to post() 2018-03-04 13:19:17 -08:00
Vinnie Falco
2fd3e46b20
Set version to 162 2018-03-01 11:33:02 -08:00
Vinnie Falco
ebd036a300 Improve websocket::stream::control_callback javadoc
fix #1053
2018-03-01 11:32:58 -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
2543dbe5b9
Set version to 161 2018-02-28 15:05:03 -08:00
Vinnie Falco
073b53e448 Fix handler parameter javadocs 2018-02-28 15:04:54 -08:00
Vinnie Falco
dfc5a2ff67 Add move-only handler tests 2018-02-28 15:04:54 -08:00
Christos Stratopoulos
5a53bd449a Don't copy the handler in write_some_op 2018-02-28 13:20:56 -08:00
Vinnie Falco
3a5f2effc1
Set version to 160 2018-02-27 08:12:58 -08:00
Vinnie Falco
d6c11a824a
Set version to 159 2018-02-26 17:09:52 -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
fc187257c3
Set version to 158 2018-02-21 14:59:02 -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
8dcc6162c1 Tidy up end_of_stream javadoc
fix #1023
2018-02-21 08:45:08 -08:00
Vinnie Falco
48a974530c
Set version to 157 2018-02-21 06:35:37 -08:00
Vinnie Falco
c505e32210 Fix big-endian websocket masking
fix #1030
2018-02-21 06:35:32 -08:00
Vinnie Falco
593ccb15cd Fix teardown for TIME_WAIT
fix #1024, fix #1029
2018-02-20 04:33:43 -08:00
Vinnie Falco
de8d0b6843
Set version to 156 2018-02-19 18:37:03 -08:00
Vinnie Falco
a4eb96fcb9 Don't use typeid 2018-02-19 18:36:30 -08:00
Vinnie Falco
1a88cb147b
Set version to 155 2018-02-16 10:51:33 -08:00
Vinnie Falco
534ba34e7e Tidy up bind_handler doc 2018-02-16 10:51:28 -08:00
Benjamin Roland Buch
b7750de15f Fix fallthrough warnings
fix #1019
2018-02-16 10:51:28 -08:00
Vinnie Falco
ab32400d00 Fix soft-mutex assert in websocket stream:
Fix #1000

This resolves the assert 'ws_.wr_block_ == tok_'.
2018-02-16 10:51:28 -08:00
Vinnie Falco
cbcc034a70
Set version to 154 2018-02-14 19:17:33 -08:00
Vinnie Falco
c9bbf7bdbc bind_handler works with boost placeholders 2018-01-26 10:12:40 -08:00
Vinnie Falco
2f03cc7895 Tidy up bind_handler doc
fix #985
2018-01-26 10:12:15 -08:00
Vinnie Falco
d855bdefd8 Type check completion handlers
fix #988
2018-01-26 08:58:19 -08:00
Vinnie Falco
908f84cb3c
Set version to 153 2018-01-25 06:02:48 -08:00
Peter Jankuliak
4fb535ece6 Fix iterator version of basic_fields::erase
fix #994
2018-01-25 06:02:43 -08:00
Vinnie Falco
ad42096a9d Avoid string_view::clear:
String views are cleared using assignment from
braced initializion, to avoid calling clear().
2018-01-25 06:02:42 -08:00
Paul "TBBle" Hampson
0efc246466 Use boost::winapi::GetLastError() consistently:
This replaces a few direct calls to ::GetLastError, and also removes a
couple of duplicate calls when the value was already held locally.
2018-01-12 12:30:39 -08:00
Paul "TBBle" Hampson
035248cefb Use make_error_code for setting an error_code from errc:
In Boost.System, `boost::system::errc` is a namespace
containing ints. In C++11, std::errc is an enum marked
as an `error_condition`.

`error_code::assign` is specified as taking an int only,
while make_error_code is able to deal correctly with both forms.
2018-01-12 12:30:39 -08:00
Vinnie Falco
3546eff033 Remove BOOST_VERSION checks
fix #722
2018-01-12 12:30:39 -08:00
Vinnie Falco
be14786550
Set version to 152 2018-01-12 11:54:37 -08:00
Vinnie Falco
cc43b46c42 Refactor WebSocket errors (API Change):
fix #949

* New error codes are introduced for WebSocket failures

* More verbose messages for error codes

* Error codes are mapped to conditions for ease of testing

* error::failed and error::handshake_failed are deprecated (don't use)

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.
2018-01-12 07:35:26 -08:00
Vinnie Falco
08a9ed4c25 Add WebSocket error conditions:
This introduces the condition enumeration type for grouping
websocket error codes together as a convenience to callers.
2018-01-01 13:38:55 -08:00
Vinnie Falco
b86169019e Refactor error headers:
The WebSocket error header file declarations are
reorganized to make it easier to move function
definitions into their own translation unit.
2018-01-01 12:17:02 -08:00
Vinnie Falco
6f08814a0c
Set version to 151 2017-12-30 13:23:45 -08:00
Vinnie Falco
841ab8474b permessage-deflate is a compile-time feature (API Change):
fix #849

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. The resulting emitted
  object code should be smaller.
2017-12-30 13:23:41 -08:00
Vinnie Falco
65d92f62fb Fix high-ASCII in source file 2017-12-30 09:20:28 -08:00
Vinnie Falco
cccb6a07fc http::parser is not MoveConstructible (API Change) 2017-12-30 06:08:28 -08:00
Vinnie Falco
b6c3cb30ae Remove unnecessary include 2017-12-29 09:26:29 -08:00
Vinnie Falco
5dcef24ea7 Add stream_fwd.hpp 2017-12-29 09:25:18 -08:00
Vinnie Falco
eddadacba7 Control callback is invoked on the execution context:
fix #954

Fix a defect where the control callback could execute
on the same stack as the initiating function.
2017-12-27 18:17:09 -08:00
Vinnie Falco
617fc42879
Set version to 150 2017-12-15 09:27:45 -08:00
Damian Jarek
b76ab4450a New BodyReader and BodyWriter constructors (API Change):
fix #884

* BodyReader and BodyWriter constructors now require the header and
  body elements to be passed as distinct header and value_type objects.

This enables the composition of body types, for example:

    http::response<compressed_body<http::string_body>> res;

* The previous single-argument constructors are deprecated and will be
  removed in a subsequent version.

Actions Required:

* Change user-defined instances of BodyReader or BodyWriter constructor
  signatures to the two-argument form.

OR

* Define the macro BOOST_BEAST_ALLOW_DEPRECATED in the project (which
  will accept both the new and the deprecated signatures).
2017-12-15 09:27:39 -08:00
Vinnie Falco
d796319476 serializer::reader_impl is deprecated:
fix #930

* The function serializer::reader_impl is deprecated and will
  be removed in a subsequent version.

* Some private symbols used in the implementation were
  also renamed to reflect correct terminology.

Actions Required:

* Call serializer::writer_impl instead of reader_impl
2017-12-14 13:13:10 -08:00
Vinnie Falco
3edb30b2e8 Set version to 149 2017-12-09 12:53:28 -08:00
Damian Jarek
aac2bf1596 Fix Travis memory utilization:
Split the websocket read test to reduce compile time memory usage
by a small amount, which ought to be enough to let it compile in
a constrained environment like Travis.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2017-12-09 12:53:28 -08:00
Damian Jarek
285965d82e handler_ptr gives the strong exception guarantee (API Change):
* The handler_ptr constructor now provides the
  strong exception guarantee.

* The signature for managed objects constructed by
  `handler_ptr` 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.
2017-12-08 10:58:46 -08:00
Damian Jarek
e08132106e handler_ptr is move-only:
It is no longer a reference counted object and now has semantics
close to a std::unique_ptr.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2017-12-04 13:07:17 -08:00
Damian Jarek
200e898f7e Don't copy completion handlers:
All asynchronous operations will now be able to use move-only
CompletionHandlers.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2017-12-04 12:14:40 -08:00
Vinnie Falco
3361df142c pausation always allocates 2017-12-04 12:14:39 -08:00
Vinnie Falco
eb0cc97e1a Protect calls from macros
fix #918
2017-12-04 12:14:11 -08:00
Vinnie Falco
13b9d1bd92 built-in r-value return values can't be assigned:
This fixes the following warning:

  warning: ‘const’ type qualifier on return type has no effect [-Wignored-qualifiers]
2017-12-04 12:14:09 -08:00
Vinnie Falco
8414dbf73b
Set version to 148 2017-12-04 12:10:36 -08:00
Vinnie Falco
4053c1bb09 Handle invalid deflate frames:
This fixes a problem where an assert is generated or an
error is ignored when an invalid deflate stream is produced
after appending the final empty deflate block.
2017-12-04 12:05:36 -08:00
Vinnie Falco
bfd4378c13
Set version to 147 2017-11-28 04:51:26 -08:00
Damian Jarek
190d20e3a8 Tidy up basic_fields exception specifiers
fix #894

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2017-11-28 04:51:18 -08:00
Vinnie Falco
8181851719 control callback is copied or moved:
The function stream::control_callback now copies or moves
the callback. In some cases this may require a dynamic
allocation.

To avoid the possibility of a dynamic allocation, callers
may wrap their callback using `std::ref` before setting it.
2017-11-27 15:05:58 -08:00
Vinnie Falco
ab91844039 Use iterator wrapper in detail::buffers_range
fix #907
2017-11-26 14:18:21 -08:00
Vinnie Falco
8c73c0d300 Don't use boost::string_ref 2017-11-26 14:01:49 -08:00
Vinnie Falco
5d83c79be4
Set version to 146 2017-11-26 12:19:01 -08:00
Vinnie Falco
b59d0a5cd5 Use variant in buffers_cat_view 2017-11-26 12:18:53 -08:00
Damian Jarek
332c2fe0cb Add detail::aligned_union and tidy up
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2017-11-26 12:18:53 -08:00
Vinnie Falco
59107701d2 Remove unintended public members of handler_ptr 2017-11-21 15:03:47 -08:00
Vinnie Falco
639266fd64 Faster ascii_tolower 2017-11-21 15:03:43 -08:00
zerotypos-found
99bf3f5556 Fix some typos 2017-11-21 08:11:20 -08:00
Vinnie Falco
6e6e1f6fbc
Set version to 145 2017-11-20 12:30:59 -08:00
Vinnie Falco
25c5f2e844 basic_fields does not support fancy pointers
fix #896
2017-11-20 12:12:06 -08:00
Vinnie Falco
110a0d52e2 null_buffers is deprecated 2017-11-20 11:48:57 -08:00
Vinnie Falco
75fcea69ee Refactor HTTP async read composed operations
fix #810
2017-11-18 19:47:35 -08:00
Vinnie Falco
5ae15432b8 Refactor basic_fields allocator internals:
fix #857

* Use empty base optimization to store the allocator

* Rebind to a smaller aligned type to reduce waste
2017-11-18 18:14:15 -08:00
Vinnie Falco
a55e67b94f Rename some detail functions 2017-11-18 18:14:14 -08:00
Vinnie Falco
a98895bc24
Set version to 144 2017-11-18 18:07:10 -08:00
Vinnie Falco
73eba08cf4 Fix websocket permessage-deflate negotiation 2017-11-18 18:06:56 -08:00
Vinnie Falco
5e2514f44a
Set version to 143 2017-11-13 12:18:47 -08:00
Vinnie Falco
fe39a7c22a
Set version to 142 2017-11-11 09:41:13 -08:00
Vinnie Falco
082767adfc
Set version to 141 2017-11-10 16:41:53 -08:00
Vinnie Falco
99d6d35c62 Tidy up some documentation
fix #880, fix #881
2017-11-10 16:41:14 -08:00
Vinnie Falco
e2d9b0dffd
Set version to 140 2017-11-08 20:13:12 -08:00
Vinnie Falco
ff2dc67afa Some basic_fields special members are protected 2017-11-08 20:13:09 -08:00
Damian Jarek
0f7670b7e0 Tidy up basic_parser:
- Add const qualifiers.
- Fix parser conversion constructor not copying header_limit_ and status_ fields.
- Use default special member functions when possible.
- Zero-initialize non-class members.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2017-11-08 20:13:09 -08:00
Casey Bodley
f96785df4f Fix signature for async_read_some, and tests
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2017-11-08 19:58:46 -08:00
Vinnie Falco
2ed1d9affb Fix some integer warnings in 64-bit builds 2017-11-07 07:10:31 -08:00
Vinnie Falco
6eba0e8f9e
Set version to 139 2017-11-05 13:03:32 -08:00
Sergey M․
8e75ed26d1 Revisit boost library min/max guidance
refs #170
2017-11-05 13:03:09 -08:00
Vinnie Falco
babb6bd59f
Set version to 138 2017-11-05 09:29:56 -08:00
Vinnie Falco
120617f438 Tidy up some documentation 2017-11-05 09:29:33 -08:00
Vinnie Falco
e8e340d098
Set version to 137 2017-11-03 19:41:45 -07:00
Vinnie Falco
d9d2b23b57 ConstBufferSequence mandates pointer equivalence
fix #865
2017-11-03 19:34:30 -07:00
Vinnie Falco
56f0b63e4d
Set version to 136 2017-11-02 15:53:14 -07:00
Vinnie Falco
8ce96d23f8
Set version to 135 2017-11-01 11:31:20 -07:00
Vinnie Falco
1e8c31913d
Set version to 134 2017-11-01 10:39:29 -07:00
Vinnie Falco
5a35a33905 Add static_buffer_base default constructor definition
fix #862
2017-11-01 10:39:01 -07:00
Vinnie Falco
d45edddd04
Set version to 133 2017-10-31 14:44:21 -07:00
Vinnie Falco
5177d729a7 Remove const&& overload of message::body 2017-10-31 14:43:10 -07:00
Vinnie Falco
e89814ff4a
Set version to 132 2017-10-30 18:51:20 -07:00
Vinnie Falco
895c9fa7ed BodyReader and BodyWriter names are swapped (API Change):
Body::reader and Body::writer meanings are reversed, for
consistency with the names of the stream operations:

* Body::reader is used for read, read_some, async_read, async_read_some
* Body::writer is used for write, write_some, async_write, async_write_some

Actions Required:

* Swap the reader and writer names for user defined Body types
* Swap use of is_body_reader and is_body_writer
2017-10-30 18:13:40 -07:00
Vinnie Falco
101023553e Fields::writer replaces Fields::reader (API Change):
* Fields::writer replaces Fields::reader
* The FieldsWriter concept is renamed from FieldsReader

Actions Required:

* Rename reader to writer for user defined Fields
2017-10-30 17:53:59 -07:00
Vinnie Falco
23bf8638ab Add ref-qualified overloads for message::body 2017-10-30 15:23:43 -07:00
Vinnie Falco
c9e291385c
Set version to 131 2017-10-30 08:25:38 -07:00
Vinnie Falco
c5a1615301 basic_fields returns const values 2017-10-29 06:45:33 -07:00
Vinnie Falco
caf1443887
Set version to 130 2017-10-27 17:04:06 -07:00
Vinnie Falco
970daa340a Tidy up fallthrough warning 2017-10-27 17:03:44 -07:00
Vinnie Falco
79bb602a20
Set version to 129 2017-10-27 11:16:15 -07:00
Vinnie Falco
597802c38a Fix prepare_payload: chunked is HTTP/1.1 2017-10-27 11:16:10 -07:00
Vinnie Falco
b5389ba5f2 Documentation tidying
fix #836
2017-10-27 11:16:09 -07:00
Vinnie Falco
ffbe65f4c9
Set version to 128 2017-10-26 08:13:43 -07:00
Vinnie Falco
85f2dcca33 Fix utf8 validation for autobahn 2017-10-25 23:24:31 -07:00
Vinnie Falco
1754d5427d Add message::need_eof 2017-10-25 18:41:04 -07:00
Vinnie Falco
5c14ab9f7c Rename some basic_parser observers (API Change):
Some `basic_parser` member functions are renamed:

* chunked() was is_chunked()
* upgrade() was is_upgrade()
* keep_alive() was is_keep_alive()

Actions Required:

* Rename member function invocations at call sites
2017-10-25 18:04:54 -07:00
Vinnie Falco
6225c5bd2f Add has_content_length_impl to Fields (API Change):
* The function has_content_length_impl is added to the
  requirements of Fields.

Actions Required:

* Implement has_content_length_impl for user-defined Fields
2017-10-25 17:58:45 -07:00
Vinnie Falco
feb525f829 Remove serializer::chunked (API Change):
* The function serializer::chunked is removed,
  since it is redundant.

Actions Required:

* Call serializer::get::chunked instead of serializer::chunked
2017-10-25 17:09:04 -07:00
Vinnie Falco
129c7d8b78 Remove serializer::keep_alive (API Change):
* The serializer::keep_alive function is removed

Actions Required:

* Call message::keep_alive instead of serializer::keep_alive
2017-10-25 17:09:03 -07:00
Vinnie Falco
80af45ecfb
Set version to 127 2017-10-25 11:45:43 -07:00
Berkus Decker
bea7d6e019 Add BOOST_BEAST_NO_POSIX_FADVISE 2017-10-25 10:17:25 -07:00
Vinnie Falco
1e9fcbad61
Set version to 126 2017-10-24 14:26:08 -07:00
Vinnie Falco
6ccc61d940 Fix buffered_read_stream async_read_some signature 2017-10-24 14:26:05 -07:00
Andrey Semashev
ab2a225a9a Update Boost.WinAPI usage to the new location and namespace. 2017-10-24 13:32:50 -07:00
Vinnie Falco
41e61a7458 Fix executor type compilation 2017-10-24 09:33:29 -07:00
Vinnie Falco
e146f2c7be Don't return end_of_stream on win32 file body writes 2017-10-23 20:19:51 -07:00
Vinnie Falco
8312c6eb86 Tidy up unused variable warnings 2017-10-23 20:19:36 -07:00
Vinnie Falco
860b764ba4
Set version to 125 2017-10-23 17:37:18 -07:00
Vinnie Falco
3a28e999af Update for Net-TS Asio (API Change):
fix #769

The following classes are removed:

* handler_type
* async_result
* async_completion
* is_dynamic_buffer
* is_const_buffer_sequence
* is_mutable_buffer_sequence
* handler_alloc

Actions Required:

* Use BOOST_ASIO_HANDLER_TYPE instead of handler_type
* Use BOOST_ASIO_INITFN_RESULT_TYPE instead of async_result
* Use boost::asio::async_completion
* Use boost::asio::is_dynamic_buffer
* Use boost::asio::is_const_buffer_sequence
* Use boost::asio::is_mutable_buffer_sequence
* boost::asio::associated_allocator_t replaces handler_alloc
2017-10-23 17:11:27 -07:00
Vinnie Falco
9dc9ca13b9
Set version to 124 2017-10-22 10:03:44 -07:00
Vinnie Falco
5c6b232654 Fix basic_fields javadoc 2017-10-22 10:03:40 -07:00
Vinnie Falco
d0d4e0a740 http write returns success on connection close (API Change):
fix #767

The write family of HTTP stream algorithms no longer returns
error::end_of_stream when the message indicates that the connection
should be closed.

Actions Required:

* Add code to servers to close the connection after successfully
  writing a message where `message::keep_alive()` would return `false`.
2017-10-22 07:03:04 -07:00
Vinnie Falco
885b9dfe0b
Set version to 123 2017-10-16 12:09:43 -07:00
Vinnie Falco
2399b610e3 Clear previous message fields in parser
fix #818
2017-10-16 12:09:41 -07:00
Vinnie Falco
f09b2d3e1c
Set version to 122 2017-10-10 08:17:28 -07:00
Vinnie Falco
8179be560e config.hpp is not a public header 2017-10-10 07:49:12 -07:00
Vinnie Falco
2ac6936312 Fix zlib symbol conflicts
fix #808
2017-10-07 13:59:04 -07:00
Vinnie Falco
a517df9090 assert on empty buffer in websocket read 2017-10-07 11:17:13 -07:00
Vinnie Falco
0bc2a41404
Set version to 121 2017-10-03 06:13:13 -07:00
Gyorgy Szekely
471638c60e Fix enum and non-enum in conditional exp. warning 2017-10-03 06:13:11 -07:00
Vinnie Falco
7fe74b1bf5
Set version to 120 2017-10-01 17:54:00 -07:00
Vinnie Falco
b3564c86ae
Set version to 119 2017-09-30 07:29:38 -07:00
Vinnie Falco
011aedc0d3 Fix typo in javadoc 2017-09-30 07:29:33 -07:00
Vinnie Falco
e35ae82dd6
Set version to 118 2017-09-26 10:03:51 -07:00
Nils Gladitz
c81558e38b file_win32 opens for read-only in shared mode:
fix #786

Without this change the second opening of an
already opened file fails with:

  "The process cannot access the file because it
  is being used by another process"
2017-09-25 21:33:04 -07:00
Peter Jankuliak
5a7b8b23db
Fix writing headers into std::ostream 2017-09-21 16:08:19 -07:00
Vinnie Falco
0f5ea371c1
Set version to 117 2017-09-20 08:31:42 -07:00
Vinnie Falco
b5f22bdef6 Add buffers_to_string
fix #772
2017-09-20 08:31:36 -07:00
Vinnie Falco
2c656a22f9 Remove buffers_suffix::get (API Change):
* buffers_suffix::get member function is removed

Actions Required:

* Avoid calling buffers_suffix::get
2017-09-20 08:31:36 -07:00
Vinnie Falco
06fb2b9dfc buffers_cat replaces buffer_cat (API Change):
fix #773

* buffer_cat is renamed to buffers_cat
* buffer_cat_view is renamed to buffers_cat_view

Actions Required:

* Use buffers_cat instead of buffer_cat
* Use buffers_cat_view instead of buffer_cat_view
2017-09-15 12:52:59 -07:00
Vinnie Falco
38c2816539 buffers_front replaces buffer_front (API Change):
fix #773

* buffer_front is renamed to buffer_front

Actions Required:

* Use buffers_front instead of buffer_front
2017-09-15 12:52:59 -07:00
Vinnie Falco
e94a65b04a buffers_prefix replaces buffer_prefix (API Change)
fix #773

* buffer_prefix is renamed to buffers_prefix
* buffer_prefix_view is renamed to buffers_prefix_view

Actions Required:

* Use buffers_prefix instead of buffer_prefix
* Use buffers_prefix_view instead of buffer_prefix_view
2017-09-15 12:52:58 -07:00
Vinnie Falco
795da80859 buffers_suffix replaces consuming_buffers (API Change):
fix #770

* consuming_buffers is renamed to buffers_suffix

Actions Required:

* Use buffers_suffix instead of consuming_buffers
2017-09-15 12:52:45 -07:00
Vinnie Falco
dca65932a8
Set version to 116 2017-09-12 17:16:07 -07:00
Vinnie Falco
38e28966ea message::version is a member function (API Change):
fix #778

* The version data member is replaced with accessor
  member functions.

Actions Required:

* Call member function message::version instead of accessing
  the version member at call sites.
2017-09-12 17:13:02 -07:00
Vinnie Falco
54fe7cacf7 message::body is a member function (API Change):
fix #778

* The body data member is replaced with accessor
  member functions.

Actions Required:

* Call member function message::body instead of accessing
  the data member at call sites.
2017-09-12 17:12:12 -07:00
Vinnie Falco
0d4d239d05
Set version to 115 2017-09-10 16:11:10 -07:00
Vinnie Falco
c388a92227
Set version to 113 2017-09-09 06:49:43 -07:00
Howard Hinnant
4880cdd472 Remove field_range copy constructor
*  This presence of the user-declared copy constructor makes
   the compiler-provided copy assignment operator deprecated.
   This change allows the compiler to provide both copy members
   without deprecated behavior.
2017-09-09 06:49:39 -07:00
Vinnie Falco
0007afdaf2 Fix handler signature in async_read_header 2017-09-09 06:39:49 -07:00
Vinnie Falco
d6fce5a00f
Set version to 112 2017-09-03 21:44:08 -07:00
Vinnie Falco
49d9d47a0b HTTP reads and writes return bytes transferred (API Change):
* HTTP read and write operations now return the
  number of bytes transferred to or from the stream.

Actions Required:

* Modify HTTP read and/or write completion handlers to receive
  the extra std::size_t bytes_transferred parameter.
2017-09-03 20:37:28 -07:00
Vinnie Falco
c0e5f14702 WebSocket writes return the bytes transferred (API Change):
* Stream write operations now return the number of bytes
transferred from the caller's input buffers.

Actions Required:

* Modify websocket write completion handlers to receive
  the extra std::size_t bytes_transferred parameter.
2017-09-03 20:05:19 -07:00
Vinnie Falco
942bca0cc3
Set version to 111 2017-08-31 17:52:39 -07:00
Vinnie Falco
647b3d68e1 Suspended ops special members 2017-08-31 17:52:37 -07:00
Vinnie Falco
51a5a36118 Refactor stream operations and tests plus coverage 2017-08-31 17:52:36 -07:00
Vinnie Falco
9f089c2a33 Fix utf8 check split code point at buffer end 2017-08-31 17:52:36 -07:00
Vinnie Falco
c8a42bba0a
Set version to 110 2017-08-29 08:22:16 -07:00
Vinnie Falco
30b98674d5 Refactor websocket stream: fixes and tests 2017-08-28 22:16:22 -07:00
Vinnie Falco
1d5b3f488e Refactor websocket stream members 2017-08-26 20:12:21 -07:00
Vinnie Falco
4c335a64cf Refactor stream open state variable 2017-08-26 20:12:04 -07:00
Vinnie Falco
526ecc5246
Set version to 109 2017-08-26 07:15:31 -07:00
Vinnie Falco
53fa8a6589 websocket test fixes 2017-08-26 07:15:25 -07:00
Vinnie Falco
df7b068fa7 websocket read tests 2017-08-25 07:40:05 -07:00
Vinnie Falco
142b785119 split up websocket tests 2017-08-24 06:38:47 -07:00
Vinnie Falco
5ac51a1054 websocket write tests 2017-08-23 14:38:29 -07:00
Vinnie Falco
2697c26238 Fix websocket close_op resume state 2017-08-23 14:34:14 -07:00
Vinnie Falco
99822aebf5 websocket ping tests 2017-08-23 14:34:13 -07:00
Vinnie Falco
6809c18afa websocket handshake uses coroutine 2017-08-23 14:34:13 -07:00
Vinnie Falco
96eff81cea websocket close fixes and tests 2017-08-23 14:34:13 -07:00
Vinnie Falco
7e815435f6 websocket accept refactoring (API Change):
* stream overloads of accept which take both a message
  and a buffer sequence are removed.

Actions Required:

* Do not call websocket accept overloads which take
  both a message and a buffer sequence, as it is
  illegal per rfc6455.
2017-08-23 14:34:13 -07:00
Vinnie Falco
7a96dc4e11 Fix async_read_some handler signature 2017-08-23 14:34:13 -07:00
Vinnie Falco
359cbb1ce4
Set version to 108 2017-08-18 07:55:40 -07:00
Vinnie Falco
b397718fbd
Set version to 107 2017-08-16 18:27:06 -07:00
Vinnie Falco
e690528132 Rename frame and header buffer types
fix #736
2017-08-15 16:59:17 -07:00
Vinnie Falco
3d6a009a96 Fix utf8 check for compressed frames 2017-08-15 16:33:25 -07:00
Vinnie Falco
a435dde2a3 Fix done state for WebSocket reads 2017-08-15 12:49:02 -07:00
Vinnie Falco
aabd33a677
Set version to 106 2017-08-15 07:01:01 -07:00
Vinnie Falco
76feb4afd4 Fix for basic_parser::skip(true) and docs
fix #742
2017-08-15 07:00:56 -07:00
Vinnie Falco
f570593a01 Tidy up utf8_checker and tests 2017-08-14 15:41:35 -07:00
Vinnie Falco
66b657a85f Autobahn|Testsuite fixes 2017-08-14 15:41:31 -07:00
Vinnie Falco
5940002c96 Websocket close will automatically drain:
fix #642

This changes websocket::stream close and async_close to automatically
read and discard incoming message frames before shutting down the
connection. It is no longer necessary to manually drain the connection.
2017-08-14 15:41:11 -07:00
Vinnie Falco
fa087e19f1 Refactor read_op + fail_op 2017-08-14 15:40:13 -07:00
Vinnie Falco
3652137718 Refactor close_op 2017-08-14 15:30:31 -07:00
Vinnie Falco
470ef85982 Refactor read_op 2017-08-14 15:30:30 -07:00
Vinnie Falco
91fb1c4b53 Refactor fail_op 2017-08-14 15:30:30 -07:00
Vinnie Falco
a98e432a2a Refactor ping_op 2017-08-14 15:30:30 -07:00
Vinnie Falco
2b484c0b8b Refactor write_op 2017-08-14 15:30:30 -07:00
Vinnie Falco
0439114fd5 Remove obsolete write_op 2017-08-14 15:30:30 -07:00
Vinnie Falco
4218a3a972 Add flat_static_buffer::reset 2017-08-14 15:30:28 -07:00
Vinnie Falco
3fe6cef129 Dynamic buffer input areas are mutable 2017-08-14 15:30:13 -07:00
Vinnie Falco
d337339c02
Set version to 105 2017-08-10 18:32:24 -07:00
Vinnie Falco
126bea987c
Set version to 104 2017-08-09 18:50:09 -07:00
Vinnie Falco
6ef4afa765 Fix pausation::save 2017-08-09 18:50:04 -07:00
Vinnie Falco
d8a1eef7a3 Tidy up some test warnings 2017-08-09 17:23:41 -07:00
Vinnie Falco
8977237f8a Use #error in config.hpp 2017-08-09 16:34:18 -07:00
Vinnie Falco
17789ba02e Remove unused include 2017-08-09 14:43:21 -07:00
Vinnie Falco
d6aca02ef8
Set version to 103 2017-08-08 19:25:39 -07:00
Vinnie Falco
0175102151 Tidy up allocator usage 2017-08-08 11:11:44 -07:00
Vinnie Falco
cf8182794a Boost test matrix fixes 2017-08-08 11:11:31 -07:00
Vinnie Falco
1366302a29
Set version to 102 2017-08-08 06:22:37 -07:00
Vinnie Falco
ca0b59894b
Set version to 101 2017-08-07 20:53:18 -07:00
Vinnie Falco
dd71b0f94d Refactor all examples:
fix #575, fix #604, fix #608, fix #634, fix #712

All examples are rewritten:

* Using Best Practices
* Mostly self-contained
* New examples to complete the feature matrix
* The server-framework example is removed
2017-08-07 20:53:11 -07:00
Vinnie Falco
20a8f7d75b
Set version to 100 2017-08-04 19:02:21 -07:00
Vinnie Falco
5e6ee5445e websocket documentation 2017-08-04 19:02:13 -07:00
Vinnie Falco
60c8a560bf Add teardown_role for correct TIME_WAIT behavior (API Change):
* teardown_tag is replaced with teardown_role, a client/server
  flag used to determine whether the shutdown is performed
  before or after reading the EOF. This is in accordance with
  RFC6455 7.1.1:

  https://tools.ietf.org/html/rfc6455#section-7.1.1

Actions Required:

* Modify signatures of teardown and async_teardown to use
  teardown_role instead of teardown_tag

* Change calls to teardown and async_teardown to pass the
  correct role: client or server depending on context.
2017-08-04 19:02:13 -07:00
Vinnie Falco
de03a1a32d drain_buffer is removed (API Change):
* The drain_buffer dynamic buffer is no longer a public interface.

Actions Required:

* Replace code which uses drain_buffer. For websocket::stream,
  it is no longer necessary to manually drain the connection
  after closing.
2017-08-04 19:02:13 -07:00
Vinnie Falco
64327739f0 WebSocket close will automatically drain (API Change):
fix #642

* Calls to stream::close and stream::async_close will
  automatically perform the required read operations

Actions Required:

* Remove calling code which drains the connection after
  calling stream::close or stream::async_close
2017-08-04 19:02:13 -07:00
Vinnie Falco
dc6a08d10a Add variadic min/max 2017-08-04 19:02:13 -07:00
Vinnie Falco
028fda0237 Fix stream::read_size_hint calculation 2017-08-04 19:02:13 -07:00
Vinnie Falco
576edfaaed eof on accept returns error::closed 2017-08-04 19:02:13 -07:00
Vinnie Falco
56a9e6ba9a Call do_fail from read_some 2017-08-04 19:02:13 -07:00
Vinnie Falco
756de5d703 Refactor fail/clode code 2017-08-04 19:02:13 -07:00
Vinnie Falco
e9d01fe79f Remove obsolete frame tests 2017-08-04 19:02:12 -07:00
Vinnie Falco
6c0fef7e7e
Version 99 2017-08-03 04:22:35 -07:00
Vinnie Falco
e5e25f5c17 Use correct handler signature in fail_op
fix #716
2017-08-03 04:21:24 -07:00
Vinnie Falco
f50f439976
Set version to 98 2017-08-01 11:56:43 -07:00
Vinnie Falco
a7069f184e basic_fields::key_compare is noexcept
fix #704
2017-08-01 06:16:26 -07:00
Vinnie Falco
6081d6e4cc
Set version to 97 2017-07-31 19:50:51 -07:00
Vinnie Falco
817a452f96
Set version to 96 2017-07-31 19:02:49 -07:00
Vinnie Falco
e3c79edebd
Set version to 95 2017-07-31 12:37:36 -07:00
Vinnie Falco
c27fbf826d Tidy up static_buffer braced init 2017-07-31 09:07:21 -07:00
Vinnie Falco
e0f0dc5bca
Set version to 94 2017-07-30 12:10:08 -07:00
Vinnie Falco
9e29a52fcb
Set version to 93 2017-07-29 17:07:09 -07:00
Vinnie Falco
5c1c841333
Set version to 92 2017-07-29 12:45:33 -07:00
Vinnie Falco
ea35f6f770 Ignore Content-Length in some cases:
fix #692

The value of Content-Length is not checked for limits
when the semantics of an HTTP response indicate that
the message has no body. For example, when status is 101.
2017-07-29 12:44:28 -07:00
Vinnie Falco
c465ed5a69 Update repository links in source comments 2017-07-29 12:44:10 -07:00
Vinnie Falco
c57f9ba18e basic_fields::value_type is not copyable
fix #697
2017-07-29 03:51:22 -07:00
Vinnie Falco
1497b4efa4
Set version to 91 2017-07-29 00:26:15 -07:00
Vinnie Falco
e15448a83a control frame callbacks are non-const references:
fix #653

Actions Required:

* Modify calls to set the control frame callback, to
  pass non-const reference instances, and manage the
  lifetime of the instance.
2017-07-28 17:07:25 -07:00
Vinnie Falco
6ab9bd2780 Use fopen_s on Windows
fix #691
2017-07-28 17:07:25 -07:00
Vinnie Falco
f02353b7f5 Use Asio array optimization in static_buffer_base
fix #689
2017-07-28 17:07:24 -07:00
Vinnie Falco
df73241a60 constexpr in derived buffers
fix #657
2017-07-28 17:07:24 -07:00
Vinnie Falco
18a698f7f6 Use read buffer instead of buffered stream 2017-07-28 17:07:24 -07:00
Vinnie Falco
70c1d361fd Refactor accept, handshake ops 2017-07-28 17:07:23 -07:00
Vinnie Falco
07535d6289 Optimize buffered_read_stream
fix #651
2017-07-28 17:07:23 -07:00
Vinnie Falco
e87bac242b Tidy up websocket javadocs 2017-07-28 17:07:23 -07:00
Vinnie Falco
c367309122 Tidy up namespace qualifiers 2017-07-28 17:07:23 -07:00
Vinnie Falco
f2da16c9f6 Don't build pre-C++11 2017-07-28 17:07:22 -07:00
Vinnie Falco
7bcfd2ed26
Set version to 90 2017-07-28 16:29:08 -07:00
Vinnie Falco
0fb562a4d7 Fix typo in equal_range
fix #688
2017-07-27 21:18:04 -07:00
Vinnie Falco
cbb47a0ffd Fix websocket read of zero length message
fix #686
2017-07-27 19:09:15 -07:00
Vinnie Falco
c7b830f37f
Set version to 89 2017-07-27 10:14:27 -07:00
Vinnie Falco
a61578634b
Set version to 88 2017-07-26 18:45:22 -07:00
Vinnie Falco
ce82e6476d Fix uninitialized frame done 2017-07-26 18:45:06 -07:00
Vinnie Falco
c2d5829f0e
Set version to 87 2017-07-25 17:47:03 -07:00
Vinnie Falco
3cba28f308 variant fixes and tests 2017-07-25 15:58:07 -07:00
Vinnie Falco
9003cf5f0b
Set version to 86 2017-07-25 10:37:48 -07:00
Vinnie Falco
e56d9955de websocket read returns the number of bytes inserted (API Change):
* read and async_read now return the number of bytes inserted
into the caller's buffer.

Actions Required:

* Change the signature of completion handlers used with
  websocket::stream::async_read to void(error_code, std::size_t)
2017-07-25 08:50:58 -07:00
Vinnie Falco
5d65f81e5f Remove spurious declaration 2017-07-24 14:47:31 -07:00
Vinnie Falco
8578f3cf76 Update copyrights 2017-07-24 09:42:51 -07:00
Vinnie Falco
7317bd0de9 Use custom variant 2017-07-23 17:36:12 -07:00
Vinnie Falco
7139dd639a Boost prep 2017-07-23 17:34:13 -07:00
Vinnie Falco
3777cb8b9c Set version to 85 2017-07-22 20:09:30 -07:00
Vinnie Falco
71ea5ebb75 Set version to 84 2017-07-20 08:15:32 -07:00
Vinnie Falco
cb501a07c8 WebSocket optimizations (API Change):
The websocket stream is optimized to contain a small
circular static buffer, reducing the number of I/O calls when
reading data. The size of the buffer is tuned for maximum
performance with TCP/IP and no long needs configuration:

* read_some replaces read_frame
* write_some replaces write_Frame
* async_read_some replaces async_read_frame
* async_write_some replaces async_write_frame

* websocket::stream::read_buffer_size is removed

Actions Required:

* Remove calls websocket::stream::read_buffer_size

* Use read_some and write_some instead of read_frame and write_frame
2017-07-20 08:15:32 -07:00
Vinnie Falco
8f3d5a094c Add consuming_buffers::get 2017-07-20 08:15:32 -07:00
Vinnie Falco
4eb926cd67 bind_handler allows placeholders 2017-07-20 08:15:32 -07:00
Vinnie Falco
5e4a5592f3 multi_buffer is type-check friendly 2017-07-20 08:15:32 -07:00
Vinnie Falco
ed7c095df9 static_buffer::consume improvement 2017-07-20 08:15:32 -07:00
Vinnie Falco
834682e650 Add detail::sum_exceeds 2017-07-20 08:15:32 -07:00
Vinnie Falco
22091d5a1c Tidy up some comments 2017-07-20 08:15:32 -07:00
Vinnie Falco
85cd2b125b Tidy up buffer_front 2017-07-20 08:15:32 -07:00
Vinnie Falco
271922e752 Set version to 83 2017-07-20 08:15:32 -07:00
Vinnie Falco
60e133ab4c read_some, async_read_some return bytes used
fix #659
2017-07-20 08:15:32 -07:00
Vinnie Falco
04887c49e0 Documentation work 2017-07-20 08:15:32 -07:00
Vinnie Falco
4e44ddbd45 Add static_buffer (API Change):
* static_buffer is added

Note this is the same name from two versions ago, when
static_buffer was renamed to flat_static_buffer for
consistency and to clear the name for a circular static
buffer.

Actions Required:

* Callers who depend on static_buffer returning sequences of
  exactly length one should switch to flat_static_buffer.
2017-07-20 08:15:32 -07:00
Vinnie Falco
47c07b0a59 Fix buffer lifetime in websocket write 2017-07-20 08:15:32 -07:00
Vinnie Falco
cee3bff060 Add buffer_front 2017-07-20 08:15:32 -07:00
Vinnie Falco
6fa9a97727 Add flat_static_buffer::mutable_data 2017-07-20 08:15:32 -07:00
Vinnie Falco
cda710bda0 Set version to 82 2017-07-20 08:15:32 -07:00
Vinnie Falco
39358a2f93 Fix extraneous argument in async_write_header
fix #655
2017-07-20 08:15:32 -07:00
Vinnie Falco
d4eaa002a8 Silence spurious warning 2017-07-20 08:15:32 -07:00
Vinnie Falco
94e92e75b7 Rename to flat_static_buffer and flat_static_buffer_base (API Change):
Actions Required:

* Rename static_buffer to flat_static_buffer_base
* Rename static_buffer_n to flat_static_buffer
2017-07-20 08:15:31 -07:00
Vinnie Falco
8fa8ecb502 Use std::function and reference wrapper 2017-07-20 08:15:31 -07:00
Vinnie Falco
3c2d3181fc accept requires a message 2017-07-20 08:15:31 -07:00
Vinnie Falco
efd715e55c stream uses flat_buffer 2017-07-20 08:15:31 -07:00
Vinnie Falco
2dced4398e Add rd_close_ to websocket stream state 2017-07-20 08:15:31 -07:00
Vinnie Falco
4d15fc455a websocket::stream tidying 2017-07-20 08:15:31 -07:00
Robert Allan Hennigan Leahy
27d070c724 is_invocable works with move-only types:
fix #652

Previously reported that function objects
taking move only types by value were not invocable.
2017-07-20 08:15:31 -07:00
Vinnie Falco
2ea3240ed6 Documentation tidying 2017-07-20 08:15:31 -07:00
Vinnie Falco
c341e8415f Set version to 81 2017-07-20 08:15:31 -07:00
Vinnie Falco
4b71aa67e0 Refactor chunked parsing (API Change):
* parser now has a callback feature for intercepting chunk headers
  and chunk bodies

* The names for basic_parser derived class callbacks have been
  refactored

* basic_parser offers an additional callback for distinguishing
  chunk body data.

Actions Required:

* Adjust signatures for required members of user-defined
  subclasses of basic_parser

* Use the new basic_parser chunk callbacks for accessing
  chunk extensions and chunk bodies.
2017-07-20 08:15:31 -07:00
Vinnie Falco
9ecd2a491e multi_buffer ctor is explicit 2017-07-20 08:15:31 -07:00
Nik Bougalis
696c4169fc Suppress incorrect GCC warning:
GCC will something generate an incorrect warning when compiling Beast
with the -Wmaybe-uninitialized flag.

For more details, see

http://www.boost.org/doc/libs/1_64_0/libs/optional/doc/html/boost_optional/tutorial/gotchas/false_positive_with__wmaybe_uninitialized.html
2017-07-20 08:15:31 -07:00
Vinnie Falco
78f3cd59a1 better is_final on empty_base_optimization 2017-07-20 08:15:31 -07:00
Vinnie Falco
b18d0d15b0 Pass string_view by value 2017-07-20 08:15:31 -07:00
Vinnie Falco
ec37172ee6 Set version to 80 2017-07-20 08:15:31 -07:00
Vinnie Falco
ff15cf8688 Refactor chunked-encoding serialization:
New buffer sequence classes are provided to allow full
control over the serialization of chunk-encoded message
payloads:

* chunk_header

    A ConstBufferSequence representing the chunk header.
    It includes a hexadecimal-encoded size, an optional
    set of chunk extensions, and the trailing CRLF
    required to denote the end of the chunk header.

    This allows the caller to manually serialize the chunk
    body in one or more calls to a stream output function.
    The caller must also output an object of type `chunk_crlf`
    to the stream to indicate the end of the chunk body.

* chunk_crlf

    A small ConstBufferSequence that simply represents
    the two character sequence "\r\n" (CRLF). This is needed
    for the case where the caller wants to output a chunk
    body as a series of buffers (i.e. "chunking a chunk").

* chunk_body

    A ConstBufferSequence representing a complete chunk.
    This includes the size, an optional set of chunk extensions,
    a caller provided buffer containing the body, and the
    required CRLF that follows.

* chunk_final

    A ConstBufferSequence representing a final chunk. It
    includes an optional set of caller-provided field trailers

* chunk_extensions

    A container for building a set of chunk extensions to use
    during serialization. The use of the container is optional,
    callers may provide their own buffer containing a correctly
    formatted set of chunk extensions, or they may use their
    own convenience container which meets the requirements.

The basic_fields container is modified to allow construction
outside the context of a message. The container can be used
to provide trailers to `chunk_final`.

Actions Required:

* Remove references to ChunkDecorators. Use the new chunk-encoding
  buffer sequences to manually produce a chunked payload body in
  the case where control over the chunk-extensions and/or trailers
  is required.
2017-07-20 08:15:31 -07:00
Vinnie Falco
02de2e5cbb Shrink chunk header buffer sequence size 2017-07-20 08:15:31 -07:00
Vinnie Falco
e9c44030e4 buffers_ref is Assignable 2017-07-20 08:15:31 -07:00
Vinnie Falco
6cec63fc9e Add basic_file_body.hpp 2017-07-20 08:15:31 -07:00
Vinnie Falco
42b81fb3a0 Remove unused file_path 2017-07-20 08:15:30 -07:00
Vinnie Falco
9bfb5374f1 Shrink buffer_prefix_view 2017-07-20 08:15:30 -07:00
Vinnie Falco
9ffb8e0f0f Add basic_dynamic_body.hpp
fix #606
2017-07-20 08:15:30 -07:00
Vinnie Falco
b65f0abd50 Javadoc tidying 2017-07-20 08:15:30 -07:00
Vinnie Falco
ca297a3980 Set version to 79 2017-07-20 08:15:30 -07:00
Vinnie Falco
b8867abf6d Remove spurious fallthrough guidance 2017-07-20 08:15:30 -07:00
Vinnie Falco
15cc4c458b Set version to 78
Signed-off-by: Vinnie Falco <vinnie.falco@gmail.com>
2017-07-20 08:15:30 -07:00
Vinnie Falco
93ae544f9c Tidy up file_posix unused variable 2017-07-20 08:15:30 -07:00
Vinnie Falco
a49b442969 Add Boost.Locale utf8 benchmark comparison 2017-07-20 08:15:30 -07:00
Vinnie Falco
5788ed2574 Remove string_view_body
Actions Required:

* Use span_body<char> instead of string_view_body
2017-07-20 08:15:30 -07:00
Vinnie Falco
83cef67fb4 Header file tidying 2017-07-20 08:15:30 -07:00
Vinnie Falco
ff05be32af Fix warning in zlib 2017-07-20 08:15:30 -07:00
Vinnie Falco
6a46e48424 Add message keep_alive, chunked, content_length members 2017-07-20 08:15:30 -07:00
Vinnie Falco
aa473a6da4 Fix spurious uninitialized warning 2017-07-20 08:15:30 -07:00
Vinnie Falco
69b61656dd Use make_unique_noinit
fix #605
2017-07-20 08:15:30 -07:00
Vinnie Falco
1f41c124c0 Documentation work 2017-07-20 08:15:30 -07:00
Vinnie Falco
37110f2d04 Add span_body 2017-07-20 08:15:30 -07:00
Vinnie Falco
c9908eada0 Tidy up includes and javadocs 2017-07-20 08:15:30 -07:00
Vinnie Falco
80eb5af584 Add span 2017-07-20 08:15:30 -07:00
Vinnie Falco
e1de01ad13 Add vector_body
fix #580
2017-07-20 08:15:30 -07:00
Vinnie Falco
c6d7fa185b Tidy up basic_string_body
fix #580
2017-07-20 08:15:30 -07:00
Vinnie Falco
222eca839a Set version to 77 2017-07-20 08:15:30 -07:00
Vinnie Falco
eb4a4d41f0 file_posix works without large file support
fix #632
2017-07-20 08:15:30 -07:00
Vinnie Falco
8f43bcc197 Set version to 76 2017-07-20 08:15:30 -07:00
Vinnie Falco
152720efaf Disable SSE4.2 optimizations 2017-07-20 08:15:30 -07:00
Vinnie Falco
a00ce1209b Fix parse illegal characters in obs-fold 2017-07-20 08:15:30 -07:00
Vinnie Falco
f657057c49 Add file_body_win32:
basic_file_body is specialized for file_win32:

When serializing file bodies to stream sockets on Windows,
the native platform function ::TransmitFile is used, improving
performance.
2017-07-20 08:15:30 -07:00
Vinnie Falco
cc198db10e serializing file_body is not const 2017-07-20 08:15:30 -07:00
Vinnie Falco
e06a055503 BodyReader, BodyWriter use two-phase init (API Change):
These types now perform error-based initialization in
a separate init() functions instead of in the constructor.

Actions Required:

* Modify instances of user-defined BodyReader and BodyWriter
  types to perfrom two-phase initialization, as per the
  updated documented type requirements.
2017-07-20 08:15:30 -07:00
Vinnie Falco
8a3df73ffc Serializer members are not const 2017-07-20 08:15:30 -07:00
Vinnie Falco
83403570bd Rename to serializer::keep_alive (API Change):
The serializer member is renamed to keep_alive()

Actions Required:

* Use serializer::keep_alive instead of serializer::close and
  take the logical NOT of the return value.
2017-07-20 08:15:30 -07:00
Vinnie Falco
a369f7d9ff Add serializer::chunked 2017-07-20 08:15:30 -07:00
Vinnie Falco
c52ddea11d Add serializer::get 2017-07-20 08:15:30 -07:00
Vinnie Falco
db59a92011 BodyReader may construct from a non-const message
fix #619
2017-07-20 08:15:30 -07:00
Vinnie Falco
0324dc371f Use Boost.Config 2017-07-20 08:15:30 -07:00
Vinnie Falco
f65a611b85 Always go through write_some:
HTTP stream serialization algorithms always go
through write_some or async_write some.
2017-07-20 08:15:30 -07:00
Vinnie Falco
ae7270463d Set version to 75 2017-07-20 08:15:30 -07:00
Vinnie Falco
5ed1c98037 Doc tidying 2017-07-20 08:15:30 -07:00
octopus-prime
288f363fa6 Using SSE4.2 intrinsics in basic_parser if available
fix #622
2017-07-20 08:15:30 -07:00
Vinnie Falco
731164bec2 Add serializer::limit 2017-07-20 08:15:30 -07:00
Vinnie Falco
d750364d6f Shrink serializer buffers using buffers_ref 2017-07-20 08:15:30 -07:00
Vinnie Falco
bb0e86ac01 Tidy up BEAST_NO_BIG_VARIANTS 2017-07-20 08:15:30 -07:00
Vinnie Falco
8ee911f632 Construct buffer_prefix_view in-place 2017-07-20 08:15:30 -07:00
Vinnie Falco
783c52b025 Set version to 74 2017-07-20 08:15:30 -07:00
Vinnie Falco
eec5f1d8b6 Add file_posix 2017-07-20 08:15:30 -07:00
Vinnie Falco
8bf46ffa05 Add file_body 2017-07-20 08:15:30 -07:00
Vinnie Falco
7254cc8976 Add file_win32 2017-07-20 08:15:30 -07:00
Vinnie Falco
ddc3099281 Add file_stdio and File concept 2017-07-20 08:15:30 -07:00
Vinnie Falco
aff5f392e2 Set version to 73 2017-07-20 08:15:30 -07:00
Vinnie Falco
abdd89fde8 Initialize local variable in basic_parser 2017-07-20 08:15:30 -07:00
Vinnie Falco
8e6fb759dd Documentation tidy 2017-07-20 08:15:29 -07:00
Vinnie Falco
f5ae60613f serializer::next replaces serializer::get (API Change):
Actions Required:

* Use serializer::next instead of serializer::get at call sites
2017-07-20 08:15:29 -07:00
Vinnie Falco
b0e52dd246 Refactor header and message constructors:
fix #581

* request and response headers now have convenience
  constructors so important fields like method, target,
  result, and version may be set upon construction.

Actions Required:

* Evaluate each message constructor call site and
  adjust the constructor argument list as needed.
2017-07-20 08:15:29 -07:00