Commit Graph

1930 Commits

Author SHA1 Message Date
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
24358f784a Disable gdb on Travis for Meltdown 2018-01-12 11:54:29 -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
45798e0a6e Refactor detect_ssl_op:
fix #955

The asynchronous SSL detector uses a stackless coroutine.
2017-12-31 10:50:26 -08:00
Vinnie Falco
d7664fa140 Redistribute the read tests in the translation units 2017-12-31 10:28:42 -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
8c5440aae1 Depend on container_hash 2017-12-30 07:11:25 -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
dabb78afe7 Sanitizer failures are errors 2017-12-23 08:46:34 -08:00
Vinnie Falco
617fc42879
Set version to 150 2017-12-15 09:27:45 -08:00
Vinnie Falco
4a4d535d98 Documentation 2017-12-15 09:27:40 -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
Damian Jarek
96e04022c4 handler_ptr tests:
fix #932

Ensure handler_ptr cleans up when move-constructing
a handler throws an exception.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2017-12-11 10:45:03 -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
eb412ee958 Fix CMakeLists.txt variable 2017-12-04 12:14:11 -08:00
Vinnie Falco
c01224ddc4 Tidy up ssl_stream special members
fix #916
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
8a2a4578b6 Merge v144-hf1 2017-12-04 12:09:24 -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
1b86bc3c36 Update reports for hybrid assessment 2017-12-04 12:05:27 -08:00
Vinnie Falco
e2b473753b Install codecov on codecov CI targets only 2017-12-04 12:04:55 -08:00
Vinnie Falco
d52e829045
Set version to 144-hf1 2017-12-03 12:50:05 -08:00
Vinnie Falco
0d8b79abb5 Install codecov on codecov CI targets only 2017-12-03 12:49:51 -08:00
Vinnie Falco
2f451badc8 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-03 01:13:41 -08:00
Vinnie Falco
1069b4ab22 Update reports for hybrid assessment 2017-12-03 01:13:23 -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
7ac24d77be Send idle pings in advanced servers:
fix #899

The timer logic for the advanced-server and advanced-server-flex
examples is refactored to use idle pings when the connection has
not seen activity for some period of time. This demonstrates the
use of the stream's control_callback interface.
2017-11-27 16:44:59 -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