247 Commits
Author SHA1 Message Date
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 d79950d95c DynamicBuffer input areas are not mutable
fix #1014
2018-02-21 13:19:14 -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 a4eb96fcb9 Don't use typeid 2018-02-19 18:36:30 -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 d855bdefd8 Type check completion handlers
fix #988
2018-01-26 08:58:19 -08:00
Vinnie Falco 3546eff033 Remove BOOST_VERSION checks
fix #722
2018-01-12 12:30:39 -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 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 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
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 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 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 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
zerotypos-found 99bf3f5556 Fix some typos 2017-11-21 08:11:20 -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 73eba08cf4 Fix websocket permessage-deflate negotiation 2017-11-18 18:06:56 -08:00
Sergey M․ 8e75ed26d1 Revisit boost library min/max guidance
refs #170
2017-11-05 13:03:09 -08:00
Vinnie Falco 120617f438 Tidy up some documentation 2017-11-05 09:29:33 -08:00
Vinnie Falco 970daa340a Tidy up fallthrough warning 2017-10-27 17:03:44 -07:00
Vinnie Falco 85f2dcca33 Fix utf8 validation for autobahn 2017-10-25 23:24:31 -07:00
Vinnie Falco 41e61a7458 Fix executor type compilation 2017-10-24 09:33:29 -07:00
Vinnie Falco 8312c6eb86 Tidy up unused variable warnings 2017-10-23 20:19:36 -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 8179be560e config.hpp is not a public header 2017-10-10 07:49:12 -07:00
Vinnie Falco a517df9090 assert on empty buffer in websocket read 2017-10-07 11:17: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 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 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 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 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 30b98674d5 Refactor websocket stream: fixes and tests 2017-08-28 22:16:22 -07:00