Commit Graph

732 Commits

Author SHA1 Message Date
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
bd3079f5b4 Fix buffers_adapter max_size 2018-06-09 13:01:30 -07:00
Vinnie Falco
f948c9cbe5 Fix move-only arguments in bind_handler 2018-05-27 19:05:43 -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
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
416f84bc63 Remove deprecated Body reader and writer ctor signatures 2018-05-04 12:47:27 -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
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
14392d7f52 Use buffers_to_string in tests
fix #782
2018-04-24 10:55:39 -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
dfc5a2ff67 Add move-only handler tests 2018-02-28 15:04:54 -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
490b9ce893 Tidy up websocket docs
fix #1035
2018-02-21 12:10:26 -08:00
Vinnie Falco
a4eb96fcb9 Don't use typeid 2018-02-19 18:36:30 -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
Peter Jankuliak
4fb535ece6 Fix iterator version of basic_fields::erase
fix #994
2018-01-25 06:02:43 -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
d7664fa140 Redistribute the read tests in the translation units 2017-12-31 10:28:42 -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
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
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
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
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
eb412ee958 Fix CMakeLists.txt variable 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
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
110a0d52e2 null_buffers is deprecated 2017-11-20 11:48:57 -08:00
Vinnie Falco
c37ce4b15e Fix name typo in http write test 2017-11-11 09:41:06 -08:00
Vinnie Falco
99d6d35c62 Tidy up some documentation
fix #880, fix #881
2017-11-10 16:41:14 -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
Miguel Portilla
a1db3cab9f Fix UTF8_checker test failures 2017-11-08 19:58:45 -08:00
Vinnie Falco
5177d729a7 Remove const&& overload of message::body 2017-10-31 14:43:10 -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
14653be0cc Tidy up FieldsReader doc 2017-10-30 15:59:05 -07:00
Vinnie Falco
23bf8638ab Add ref-qualified overloads for message::body 2017-10-30 15:23:43 -07:00
Vinnie Falco
e39e4c73bf Rename Cmake variables for clarity 2017-10-30 12:35:56 -07:00
Vinnie Falco
42679ee0bc Tidy up project folders in CMakeLists.txt 2017-10-30 12:35:55 -07:00
Vinnie Falco
d8a0200929 Remove cxx11_sfinae_expr build requirement from tests 2017-10-27 17:03:44 -07:00
Vinnie Falco
c029efaf7c Temporarily disable utf8 validation tests 2017-10-26 00:00:35 -07:00
Vinnie Falco
85f2dcca33 Fix utf8 validation for autobahn 2017-10-25 23:24:31 -07:00
Vinnie Falco
3d3bc87042 Use synchronous writes in chunk output example 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
4927fa42d7 More Jamfile compiler requirements for tests 2017-10-25 11:45:40 -07:00
Vinnie Falco
41e61a7458 Fix executor type compilation 2017-10-24 09:33:29 -07:00
Vinnie Falco
1faac0b0fb Update stream write documentation for end of stream changes 2017-10-23 18:36:01 -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
56fee93601 Fix for a test matrix compiler 2017-10-22 07:03:14 -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
2399b610e3 Clear previous message fields in parser
fix #818
2017-10-16 12:09:41 -07:00
Vinnie Falco
e832baf93f Check compiler feature in Jamfile 2017-10-16 09:16:26 -07:00
Vinnie Falco
a30d30e379 Fix spurious race in websocket close test 2017-10-15 10:41:16 -07:00
Vinnie Falco
1e412715b1 Use unit-test subtree 2017-10-15 09:00:07 -07:00
Vinnie Falco
6ca2ef8449 Add missing case in error test 2017-10-10 08:17:23 -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
6e08fa0a21 Add test for issue 807 2017-10-05 19:24:35 -07:00
Vinnie Falco
f5f1b7d6fa Add test for issue 802 2017-10-03 06:13:10 -07:00
Peter Jankuliak
5a7b8b23db
Fix writing headers into std::ostream 2017-09-21 16:08:19 -07:00
Vinnie Falco
b5f22bdef6 Add buffers_to_string
fix #772
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
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
0007afdaf2 Fix handler signature in async_read_header 2017-09-09 06:39:49 -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
cc8246e27e Update websocket notes 2017-09-03 20:05:20 -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
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
b13e02bb55 Fix invalid iterator in test reporter
fix #755
2017-08-29 08:22:12 -07:00
Damian Jarek
96c53a048f Add Add test::stream::lowest_layer:
This allows the stream to be used as the next layer type in
a stack of network stream layers.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2017-08-28 22:16:23 -07:00
Vinnie Falco
30b98674d5 Refactor websocket stream: fixes and tests 2017-08-28 22:16:22 -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
463accffd1 Refactor test::stream 2017-08-23 14:34:13 -07:00
Vinnie Falco
99822aebf5 websocket ping tests 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
2c73eeef7c Use test::stream 2017-08-16 18:26:48 -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
fa087e19f1 Refactor read_op + fail_op 2017-08-14 15:40:13 -07:00
Vinnie Falco
ffd20b91f7 websocket test improvements 2017-08-14 15:30:29 -07:00
Vinnie Falco
a56b390638 Tidy up Jamfile and tests 2017-08-10 18:32:21 -07:00
Vinnie Falco
483a4c5da5 Fix compile error in websocket snippet 2017-08-10 16:28:20 -07:00
Vinnie Falco
d8a1eef7a3 Tidy up some test warnings 2017-08-09 17:23:41 -07:00
Vinnie Falco
cf8182794a Boost test matrix fixes 2017-08-08 11:11:31 -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
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
e9d01fe79f Remove obsolete frame tests 2017-08-04 19:02:12 -07:00
Vinnie Falco
387d68f336 Reorder define test macro params 2017-08-04 19:02:12 -07:00
Vinnie Falco
2567f49fb5 Rename test macros 2017-08-04 19:02:12 -07:00
Vinnie Falco
444ef321a5 Remove unused test header 2017-08-04 19:02:07 -07:00
Vinnie Falco
e5e25f5c17 Use correct handler signature in fail_op
fix #716
2017-08-03 04:21:24 -07:00
Miguel Portilla
ee04fa096b Trim utf8 checker test 2017-08-01 11:56:37 -07:00
Daniel James
66b07798e6 Use unique names for Jam projects 2017-08-01 11:31:50 -07:00
Vinnie Falco
0e5117e006 Fix bench-zlib cmake 2017-08-01 06:18:13 -07:00
Vinnie Falco
7b364af6e0 Less compression on websocket test 2017-07-31 19:02:48 -07:00
Vinnie Falco
7b90ff852d Faster zlib tests 2017-07-31 19:02:48 -07:00
Vinnie Falco
b0d7bc2e86 Add bench-zlib 2017-07-31 19:02:47 -07:00
Vinnie Falco
3fb5d60db2 Rename wsload compile target 2017-07-31 19:02:46 -07:00
Vinnie Falco
030f5eef87 Move extras/ to test/ 2017-07-31 19:02:46 -07:00
Vinnie Falco
df9ec6c7f3 Move bench/ to test/ 2017-07-31 19:02:46 -07:00
Vinnie Falco
8def3b1ba7 Add valgrind variant, fix false positives 2017-07-31 12:37:32 -07:00
Vinnie Falco
6e3c63e685 Add test::stream 2017-07-31 09:07:21 -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
b5d9ce8a27 Fix typo in test/CMakeLists.txt 2017-07-29 03:39:34 -07:00
Vinnie Falco
809e822789 Refactor test build scripts 2017-07-29 00:26:05 -07:00
Vinnie Falco
698884d8bb Move benchmarks to bench/ 2017-07-28 18:55:32 -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
0dc2c9d810 Rename wstest source file 2017-07-28 17:07:24 -07:00
Vinnie Falco
c367309122 Tidy up namespace qualifiers 2017-07-28 17:07:23 -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
59f7819cf6 Refactor tests Jamfile 2017-07-26 11:46:01 -07:00
Vinnie Falco
3cba28f308 variant fixes and tests 2017-07-25 15:58:07 -07:00
Vinnie Falco
c831afd93b Rename to BEAST_EXPECT 2017-07-25 15:58:06 -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
8578f3cf76 Update copyrights 2017-07-24 09:42:51 -07:00
Vinnie Falco
198846d7bd Update CMakeLists.txt for boost 2017-07-23 20:04:07 -07:00
Vinnie Falco
b97586b318 Remove use of lexical_cast 2017-07-23 17:34:41 -07:00
Vinnie Falco
7139dd639a Boost prep 2017-07-23 17:34:13 -07:00
Vinnie Falco
e5a4dc6a96 Tidy up test warning 2017-07-22 20:09:24 -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
4eb926cd67 bind_handler allows placeholders 2017-07-20 08:15:32 -07:00
Adrian Imboden
871ebf1c1c Fix private timer::clock_type
fix #662
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
cb21b117bf Turn some flat_static_buffer_tests on 2017-07-20 08:15:32 -07:00
Vinnie Falco
2b89bbce41 Add wstest compression option 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
39358a2f93 Fix extraneous argument in async_write_header
fix #655
2017-07-20 08:15:32 -07:00
Vinnie Falco
bd5ab6ffd0 Add wstest benchmark tool 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
1d7d7445d5 Add session_alloc to example/common 2017-07-20 08:15:31 -07:00
Vinnie Falco
3c2d3181fc accept requires a message 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
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
cc73d883be File is not copy-constructible 2017-07-20 08:15:31 -07:00
Vinnie Falco
32cd5e4082 Update test zlib to 1.2.11 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
6cec63fc9e Add basic_file_body.hpp 2017-07-20 08:15:31 -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
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
fa45e6ad07 Tidy up FieldsReader doc 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
cc02d4a78e Tidy up invalid characters in test vector 2017-07-20 08:15:30 -07:00
Vinnie Falco
f34d4f7204 span, string, vector bodies are public 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
a00ce1209b Fix parse illegal characters in obs-fold 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
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
b1a8cf8a13 file_body tests 2017-07-20 08:15:30 -07:00
Vinnie Falco
731164bec2 Add serializer::limit 2017-07-20 08:15:30 -07:00
Vinnie Falco
eec5f1d8b6 Add file_posix 2017-07-20 08:15:30 -07:00
Vinnie Falco
e81026614a Remove common/file_body.hpp 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
48c0fcae50 Adjust benchmarks 2017-07-20 08:15:30 -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
Vinnie Falco
2ee088de5f Add basic_parser tests 2017-07-20 08:15:29 -07:00
Vinnie Falco
e608acb791 basic_parser optimizations:
fix #185, fix #489

* SSE4.2 is detected

* basic_parser uses SSE4.2 if available

* basic_parser tries to parse on the initial buffer and if
  it does not find the end of header it shifts to a new
  strategy of waiting for the end of header to defeat
  slow loris attacks. This coincidentally is also faster
  than the previous algorithm.
2017-07-20 08:15:29 -07:00
Vinnie Falco
09df24ec62 Refactor file_body for best practices 2017-07-20 08:15:29 -07:00
Vinnie Falco
ff33783d11 Refine Body::size specification 2017-07-20 08:15:29 -07:00
Vinnie Falco
c149321013 Return std::size_t from Body::writer::put (API Change)
`put` returns the number of bytes actually transferred
from the input buffers.

Actions Required:

* Return the number of bytes actually transferred from the
  input buffers in user defined `Body::writer::put` functions.
2017-07-20 08:15:29 -07:00
Vinnie Falco
f3afc834b1 Check trailers in test 2017-07-20 08:15:29 -07:00
Sacha
7f05f67464 Add options for building examples and tests.
Move zlib test sources to test/zlib
2017-07-20 08:15:29 -07:00
Vinnie Falco
2843a497a0 Documentation revision
fix #567, fix #572
2017-07-20 08:15:29 -07:00
Vinnie Falco
7753d6eda2 Add parser::on_header to set a callback 2017-07-20 08:15:29 -07:00
Vinnie Falco
788550e833 Add basic_parser header and body limits:
fix #550

* default body limits are now 1MB/8MB
* default header limit is 8KB

Actions Required:

* Call body_limit and/or header_limit as needed to adjust the
  limits to suitable values if the defaults are insufficient.
2017-07-20 08:15:29 -07:00
Vinnie Falco
58d42cc803 Use BEAST_FALLTHROUGH to silence warnings
fix #545
2017-07-20 08:15:29 -07:00
Vinnie Falco
f3eaa409d1 basic_parser optimizations 2017-07-20 08:15:29 -07:00
octopus-prime
b5b1295d0c Add const_body, mutable_body to examples 2017-07-20 08:15:29 -07:00
Vinnie Falco
2d6859831c Optimize field lookups 2017-07-20 08:15:29 -07:00
Vinnie Falco
43f8bb841a bad_target replaces bad_path (API Change):
Actions Required:

* Replace references to http::error::bad_path with http::error::bad_target
2017-07-20 08:15:29 -07:00
Vinnie Falco
beead1a297 Split common tests to a new project 2017-07-20 08:15:29 -07:00
Vinnie Falco
edeb44617b Remove BodyReader::is_deferred (API Change):
The is_deferred nested type is removed from the BodyReader
requirements.

Performance for sending messages with `file_body` was cut
almost in half with is_deferred as `std::true_type` since
it caused double the number of socket writes. If the
deferred behavior is absolutely necessary, callers can get
the same effect by manually sending the headers first.

Actions Required:

* Callers who need the behavior of is_deferred as `std::true_type`
  should manually construct a serializer and serialize the header
  first, followed by the body.
2017-07-20 08:15:29 -07:00
Vinnie Falco
bf59634bc2 Change BodyReader, BodyWriter requirements (API Change):
Actions Required:

* Change user defined instances of BodyReader and BodyWriter
  to meet the new requirements.
2017-07-20 08:15:29 -07:00
Vinnie Falco
bb1dd72638 Group common example headers 2017-07-20 08:15:29 -07:00
Vinnie Falco
e7b01dc5c4 control_callback replaces ping_callback (API Change):
fix #322

The new callback is informed of all frame types including close.

Actions Required:

* Change calls to websocket::stream::ping_callback to use
  websocket::stream::control_callback

* Change user defined ping callbacks to have the new
  signature and adjust the callback definition appropriately.
2017-07-20 08:15:28 -07:00
Vinnie Falco
cc1c02e236 Merge stream_base to stream and tidy 2017-07-20 08:15:28 -07:00
Vinnie Falco
e389b853c5 Documentation work 2017-07-20 08:15:28 -07:00
Vinnie Falco
dab5d3bc12 Handle bad_alloc in parser 2017-07-20 08:15:28 -07:00
Vinnie Falco
86244c8dcf Add serializer request/response aliases 2017-07-20 08:15:28 -07:00
Vinnie Falco
518ae23383 string_param optimizations 2017-07-20 08:15:28 -07:00
Vinnie Falco
8f4e7fd0a0 Fix unused variable warnings 2017-07-20 08:15:28 -07:00
Vinnie Falco
d70a78bbda Fix integer warnings 2017-07-20 08:15:28 -07:00
Vinnie Falco
e477574681 Remove make_serializer (API Change):
Actions Required:

* Replace calls to make_serializer with variable declarations
2017-07-20 08:15:28 -07:00
Vinnie Falco
b2ab40f09c Doc tidying
fix #521, fix #524
2017-07-20 08:15:28 -07:00
Vinnie Falco
67e3e801cb Exemplars are compiled code
fix #455
2017-07-20 08:15:28 -07:00
Vinnie Falco
65b127d2e6 Tidy up Jamfiles 2017-07-20 08:15:28 -07:00
Vinnie Falco
26b5e91725 Tidy up CMakeLists.txt 2017-07-20 08:15:28 -07:00
Vinnie Falco
3ff585d36e Only run the tests under ubasan 2017-07-20 08:15:28 -07:00
Vinnie Falco
7b8149cfd4 Move benchmarks to a separate project 2017-07-20 08:15:27 -07:00
Vinnie Falco
9c4b3ed2a7 Only build and run tests in variant=coverage 2017-07-20 08:15:27 -07:00
Vinnie Falco
5613ce7e97 Add http::is_fields trait
fix #515
2017-07-20 08:15:27 -07:00
Vinnie Falco
56a561da9a message::prepare_payload replaces message::prepare (API Change):
Actions Required:

* Change calls to msg.prepare to msg.prepare_payload. For messages
  with a user-defined Fields, provide the function prepare_payload_impl
  in the fields type according to the Fields requirements.
2017-07-20 08:15:27 -07:00
Vinnie Falco
f9f6e1e0cc Refine FieldsReader concept (API Change)
* FieldsReader now requires chunked() and keep_alive()

* serializer logic calls into the reader to calculate
  the message metadata

* Removed some of the previous requirements of FieldsReader

Actions Required:

* Implement chunked() and keep_alive() for user defined FieldsReader types.
2017-07-20 08:15:27 -07:00
Vinnie Falco
50902c3938 parser requires basic_fields (API Change):
* `parser` is now templated on Allocator

* `parser` only produces messages using `basic_fields<Allocator>`
  as the Fields type.

* message-oriented read and async_read only work on messages
  using basic_fields as the Fields type.

Actions Required:

* Callers using `parser` with Fields types other than basic_fields
  will need to create their own subclass of basic_parser to work
  with their custom fields type.
2017-07-20 08:15:27 -07:00
Vinnie Falco
4d393f4c2a Clear the error faster 2017-07-20 08:15:27 -07:00
Vinnie Falco
d5f15976e7 Tidy up test build scripts and projects 2017-07-20 08:15:27 -07:00
Vinnie Falco
79eb97fbd6 Add server-framework tests 2017-07-20 08:15:27 -07:00
Vinnie Falco
e4ed62df0b Increase detail::static_ostream coverage 2017-07-20 08:15:27 -07:00
Vinnie Falco
abed397bc0 Don't run slow tests on certain targets 2017-07-20 08:15:27 -07:00
Vinnie Falco
0a4f964811 Tidy up resolver calls 2017-07-20 08:15:27 -07:00
Vinnie Falco
a4a4121444 Add multi_port to server-framework 2017-07-20 08:15:27 -07:00
Vinnie Falco
8f627b0748 Fix shadowing warnings
fix #510
2017-07-20 08:15:27 -07:00
Vinnie Falco
65932ee343 Add server-framework SSL HTTP and WebSocket ports 2017-07-20 08:15:27 -07:00
Vinnie Falco
c8b8439ebc Tidy up names in error categories 2017-07-20 08:15:27 -07:00
Vinnie Falco
30e6426db5 Tidy up some integer conversion warnings 2017-07-20 08:15:27 -07:00
Vinnie Falco
fd9a13b11f New server-framework, full featured server example:
A new server framework is introduced, allowing users to
quickly get off the ground. Example servers are refactored
to use the common framework.
2017-07-20 08:15:26 -07:00
Vinnie Falco
b5306a5712 String comparisons are public interfaces 2017-07-20 08:15:26 -07:00
Vinnie Falco
321aa8527d Fix base64 alphabet
fix #500
2017-07-20 08:15:26 -07:00
Sacha
0a2a03acfa Integrated Beast interface. 2017-07-20 08:15:26 -07:00
Vinnie Falco
dba4be01ab Fix parsing chunk size with leading zeroes
fix #496
2017-07-20 08:15:26 -07:00
Vinnie Falco
f64109d79a Fix basic_fields insert ordering 2017-07-20 08:15:26 -07:00
Vinnie Falco
eb7e971c7a Renamed to basic_fields::set (API Change):
* `replace` is renamed to `set`

Actions Required:

* Rename calls to `basic_fields::replace` to `basic_fields::set`
2017-07-20 08:15:26 -07:00
Vinnie Falco
510092d34b Reorganize examples:
* The examples/ directory is renamed to example/

* Each program is in its own directory with its own build scripts
2017-07-20 08:15:26 -07:00
Vinnie Falco
2eeedb8a41 Fix warning in basic_parser.cpp 2017-07-20 08:12:20 -07:00
Vinnie Falco
82d76e4882 Convert buffer in range loops
fix #485
2017-07-20 08:12:20 -07:00
Vinnie Falco
9939320c83 More basic_parser tests 2017-07-20 08:12:20 -07:00
Vinnie Falco
ca109693fb Reset error codes
fix #478
2017-07-20 08:12:20 -07:00
Vinnie Falco
7d92048c5c Test error code handling
fix #478
2017-07-20 08:12:20 -07:00
Vinnie Falco
7712ca09b2 Add string_view_body 2017-07-20 08:12:20 -07:00
Vinnie Falco
0f54bc72a4 Add provisional IANA header field names
fix #473
2017-07-20 08:12:20 -07:00
Vinnie Falco
4d21f8d2cf Revert "Add a Beast CMake interface target:"
This reverts commit 906db45bec35ce9bb4ba0448aaa4c8955f3c62e2.
2017-07-20 08:12:20 -07:00
Vinnie Falco
7bde07a850 Documentation work 2017-07-20 08:12:20 -07:00
Vinnie Falco
a49c096042 read_size replaces read_size_helper:
* detail::read_size_helper is removed

* public function read_size helps determine the optimum
  size for calls to a DynamicBuffer's prepare function.

* special case for Asio types which don't conform to
  the concept but have their own helper function.
2017-07-20 08:12:20 -07:00
Sacha
3c453209fe Add a Beast CMake interface target:
fix #461

This target allows other CMake projects to acquire
the Beast headers and link libraries easily.
2017-07-20 08:12:19 -07:00
Vinnie Falco
d529d6a16f Documentation work 2017-07-20 08:12:19 -07:00
Vinnie Falco
8c4136bb73 basic_fields refactor (API Change):
* Container interface more closely matches std::vector

* While preserving the invariant that duplicate fields
  with the same case-insensitive name have their order
  preserved.
2017-07-20 08:12:19 -07:00
Vinnie Falco
0d70d90b75 Add string_param
fix #451
2017-07-20 08:12:19 -07:00
Vinnie Falco
49a2b33b82 basic_fields members and coverage 2017-07-20 08:12:19 -07:00
Vinnie Falco
e58833d7dd consuming_buffers members and coverage 2017-07-20 08:12:19 -07:00
Vinnie Falco
260b506520 multi_buffer members and coverage
fix #458
2017-07-20 08:12:19 -07:00
Vinnie Falco
5d6d486da4 flat_buffer coverage 2017-07-20 08:12:19 -07:00
Vinnie Falco
99f2425de4 static_buffer coverage 2017-07-20 08:12:19 -07:00
Vinnie Falco
78f4858e98 Fix read_size_helper usage:
read_size_helper can return zero if the buffer reaches
its maximum size, causing infinite loops in HTTP. The
function maybe_read_size_helper is provided to throw
an exception instead of returning a value for this case.
2017-07-20 08:12:19 -07:00
Vinnie Falco
5149cf8495 Add drain_buffer class
fix #457
2017-07-20 08:12:19 -07:00
Vinnie Falco
23863230de flat_buffer is an AllocatorAwareContainer
fix #453
2017-07-20 08:12:19 -07:00
Vinnie Falco
44995bf071 Documentation work 2017-07-20 08:12:19 -07:00
Vinnie Falco
b49b23ee83 finish(error_code&) is a BodyReader requirement (API Change) 2017-07-20 08:12:19 -07:00
Vinnie Falco
64742a4183 opcode is private (API Change):
* The opcode enum is removed.

Actions Required:

* Remove all occurences of the `opcode` enum at call sites
2017-07-20 08:12:19 -07:00
Vinnie Falco
ce70d45c7a Disable std::future snippet for libstdc++ bug 2017-07-20 08:12:19 -07:00
Vinnie Falco
9e910761cc read_frame returns bool fin (API Change):
* frame_info struct is removed

* read_frame and async_read_frame return a bool indicating
  if the frame is the last frame of the current message.

Actions Required:

* Remove the frame_info parameter from all read frame call sites

* Check the return value 'fin' for calls to read_frame

* Change ReadHandlers passed to async_read_frame to have
  the signature void(error_code, bool fin), use the bool
  to indicate if the frame is the last frame.
2017-07-20 08:12:19 -07:00
Vinnie Falco
620ce08d6a Remove opcode from read, async_read (API Change):
fix #446

* Read signatures no longer include `opcode`

* stream::got_binary and stream::got_text inform the caller if
  the current incoming message is binary or text.

Actions Required:

* Remove the `opcode` reference parameter from calls to synchronous
  and asynchronous read functions, replace the logic with calls to
  stream::got_binary and stream::got_text instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco
3d6574da81 ping_callback is a member of stream (API Change):
fix #446

* The ping_callback option struct is removed.

Actions Required:

* Change call sites which use ping_callback with set_option to
  call stream::ping_callback instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco
333067243f write_buffer_size is a member of stream (API Change):
fix #446

* The write_buffer_size option struct is removed.

Actions Required:

* Change call sites which use write_buffer_size with set_option to
  call stream::write_buffer_size instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco
b9dbb76c4f read_message_max is a member of stream (API Change):
fix #446

* The read_message_max option struct is removed.

Actions Required:

* Change call sites which use read_message_max with set_option to
  call stream::read_message_max instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco
513a54835c read_buffer_size is a member of stream (API Change):
fix #446

* The read_buffer_size option struct is removed

Actions Required:

* Change call sites which use read_buffer_size with set_option to
  call stream::read_buffer_size instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco
e6c0d698ee binary, text are members of stream (API Change):
fix #446

* message_type is removed

Actions Required:

* Change call sites which use message_type with set_option
  to call stream::binary or stream::text instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco
f22895224b auto_fragment is a member of stream (API Change):
fix #374, fix #446

* auto_fragment option struct is removed

Actions Required:

* Change call sites which use auto_fragment with set_option
  to call stream::auto_fragment instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco
669b1feae1 Documentation work 2017-07-20 08:12:19 -07:00
Vinnie Falco
04522398e0 Fix infinite loop in basic_parser
fix #452
2017-07-20 08:12:19 -07:00
Vinnie Falco
7b56f352b4 Add construct, destroy to handler_alloc
fix #432
2017-07-20 08:12:19 -07:00
Vinnie Falco
196d9c60fa multi_buffer implementation change (API Change):
fix #440

WARNING

multi_buffer constructor now takes a maximum size instead of the
"allocation size". This is a breaking change. The allocation size
feature is removed. To update calling code, remove the allocation
size parameter from call sites.

* multi_buffer now uses a geometric growth algorithm for better performance.
2017-07-20 08:12:19 -07:00
Vinnie Falco
74c26a8869 DynamicBuffer benchmarks
fix #441
2017-07-20 08:12:19 -07:00
Vinnie Falco
55358835c6 Use BOOST_FALLTHROUGH
fix #437
2017-07-20 08:12:19 -07:00
Vinnie Falco
cff5be3837 Documentation work 2017-07-20 08:12:19 -07:00
Vinnie Falco
7952578e1d Tune up static_buffer (API Change):
The static buffer is updated:

* reset() is no longer a member. Use b.consume(b.size()) instead.

* Simplified implementaton, uses asio instead of custom types

* Better stream performance: consuming the input makes room
  available in the output. This class is now suitable for
  HTTP reads.

These changes permit the static_buffer wrapper to adapt a user
memory buffer if desired, including a stack based array.
The static_buffer_n class may also be used for this purpose,
it comes with its own storage.
2017-07-20 08:12:19 -07:00
Vinnie Falco
6203074c92 Fix chunk header parsing
fix #431, fix #430
2017-07-20 08:12:18 -07:00
Vinnie Falco
7d89fdc46f Remove obsolete serializer allocator (API Change) 2017-07-20 08:12:18 -07:00
Vinnie Falco
aa752e4dce Remove message free functions (API Change) 2017-07-20 08:12:18 -07:00