Commit Graph

1309 Commits

Author SHA1 Message Date
Vinnie Falco
ca783225da Appveyor uses msvc-14.0 2019-03-02 10:51:56 -08:00
Vinnie Falco
1432d336be Move parser definitions to .ipp 2019-03-02 09:13:08 -08:00
Vinnie Falco
edf5b7cd03 Fix HTTP parser static string calculation 2019-03-02 09:13:08 -08:00
Vinnie Falco
fca4b3ae10 make_strand is in net:: 2019-03-02 07:33:57 -08:00
Vinnie Falco
8c53abe6e5 Support -fno-exceptions 2019-03-01 13:52:50 -08:00
Vinnie Falco
737d7a97e6 Remove session_alloc (API Change)
* session_alloc is removed, as it does not improve
  performance as intended.

Actions Required:

* Don't use session_alloc
2019-03-01 12:02:40 -08:00
Vinnie Falco
272b6f23e4 Examples use flat_buffer
fix #1488
2019-03-01 12:02:28 -08:00
Vinnie Falco
7806672f42 Fix wsload jamfile 2019-03-01 11:28:44 -08:00
Vinnie Falco
bf2523b190 Tidy up an unused function 2019-03-01 11:02:52 -08:00
Vinnie Falco
00487f1de6 Reusing an HTTP parser returns an error 2019-02-28 10:27:43 -08:00
Vinnie Falco
8eb15148d7 Advanced servers use HTTP parser interfaces for reading 2019-02-28 10:04:52 -08:00
Vinnie Falco
16280f9991 Remove extraneous error check in advanced-server-flex
fix #1484
2019-02-28 07:54:20 -08:00
Vinnie Falco
92ad50a8e7 Destroy abandoned websocket ops on shutdown
fix #1358
2019-02-27 16:44:01 -08:00
Damian Jarek
72a99c43a7 Pausation abandoning test
Check if paused operations are correctly abandoned when the
ExecutionContext shuts down.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-02-27 16:42:41 -08:00
Vinnie Falco
031e13c253 Add websocket service 2019-02-27 16:42:19 -08:00
Vinnie Falco
c510662c67 Add test::stream::service 2019-02-27 14:05:16 -08:00
Vinnie Falco
8f9eed1faf stream_base::timeout::suggested is a nested function 2019-02-27 06:52:45 -08:00
Vinnie Falco
7953ac281f Pass references as pointers to async_initiate 2019-02-26 07:21:05 -08:00
Vinnie Falco
ab9a4c66e0 Doc work 2019-02-26 07:21:04 -08:00
Vinnie Falco
0647c902ac role_type is in boost/beast/core/role.hpp (API Change):
This enumeration is now part of the library core and
not specific to websocket.
2019-02-26 07:20:46 -08:00
Vinnie Falco
81f33a0f89 Rename to async_base, stable_async_base 2019-02-26 07:20:08 -08:00
Vinnie Falco
6331e03a3a OpenSSL is required for tests and examples 2019-02-23 11:15:59 -08:00
Vinnie Falco
59bda5d9c6 basic_parser is abstract, not CRTP (API Change):
* `basic_parser` now uses pure virtual member functions instead
  of the curiously recurring template pattern.

Actions Required:

* Change uses of the `basic_parser` type to omit the `Derived`
  template parameter

* Classes derived from `basic_parser` no longer need to friend
  the base.

* Virtual functions in the derived class may be marked `override`.
2019-02-23 11:15:59 -08:00
Vinnie Falco
bbd62dd181 ssl_stream is a public interface 2019-02-23 09:57:45 -08:00
Vinnie Falco
094f5ec5cb Better treatment of SSL short reads:
fix #38

This improves the behavior when encountering a short read:

* Any stream error encountered during a read is converting into
  `http::error::partial_message` if some data was received but
  the message is incomplete.

* Examples squelch SSL short read errors from the logs.
2019-02-23 08:56:59 -08:00
Vinnie Falco
73c7f3ea3e Visual Studio 2017 minimum requirement for Windows 2019-02-22 18:46:09 -08:00
Damian Jarek
d048aa8e7e More split definitions in test::stream
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-02-22 17:42:44 -08:00
Vinnie Falco
955354b9dd Enable split Beast compilation for tests 2019-02-22 17:27:27 -08:00
Damian Jarek
4a5ab9785c Add OpenSSL installation/setup instructions
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-02-22 17:27:11 -08:00
Vinnie Falco
90b783cb62 detect_ssl, async_detect_ssl are public interfaces 2019-02-22 15:39:34 -08:00
Vinnie Falco
ee13bfad70 Fast prng is pcg 2019-02-21 13:19:23 -08:00
Vinnie Falco
6ada618c12 Check BOOST_NO_CXX11_THREAD_LOCAL 2019-02-21 11:09:02 -08:00
Vinnie Falco
d08cc82e15 Use async_initiate 2019-02-21 06:39:35 -08:00
Vinnie Falco
51994d133f Release notes 2019-02-20 18:58:59 -08:00
Vinnie Falco
c3c3777661 Pass strand to async_accept 2019-02-20 15:30:03 -08:00
Vinnie Falco
fd4b080a4a RatePolicy documentation 2019-02-20 15:30:03 -08:00
Vinnie Falco
28d3b41a43 websocket idle pings 2019-02-20 07:12:36 -08:00
Vinnie Falco
28f5921bd6
Set version to 216 2019-02-20 07:12:11 -08:00
Vinnie Falco
23a7bcc67e Add RatePolicy to basic_stream 2019-02-19 16:23:30 -08:00
Vinnie Falco
ac24e58fb3 Add make_strand 2019-02-19 16:23:30 -08:00
Vinnie Falco
fc7b47fc5d Use suggested timeouts in Websocket examples 2019-02-18 12:18:27 -08:00
Vinnie Falco
f21358186e Add websocket::stream timeouts 2019-02-18 12:18:27 -08:00
Vinnie Falco
dfd08bf6ae Refactor websocket::stream operations 2019-02-18 12:18:27 -08:00
Vinnie Falco
00e8c381cd Examples use ssl_stream
fix #1455
2019-02-16 15:09:35 -08:00
Vinnie Falco
22dcb4a3cb example/cppcon2018 is removed:
* Replaced by websocket-chat-multi
2019-02-16 15:09:35 -08:00
Vinnie Falco
f41363c60c Add async_op_base::invoke 2019-02-16 15:09:33 -08:00
Vinnie Falco
fdaf2ea7e1 Rename to async_op_base::invoke_now 2019-02-16 13:36:01 -08:00
Vinnie Falco
a781285e2f Add experimental test/handler.hpp 2019-02-16 13:36:01 -08:00
Vinnie Falco
18447553ca Examples use bind_front_handler 2019-02-14 17:28:54 -08:00
Vinnie Falco
92add2afa6 bind_front_handler works with member functions 2019-02-14 16:16:04 -08:00
Vinnie Falco
d410b429c0 Remove bind_back_handler 2019-02-14 16:11:14 -08:00
Vinnie Falco
5ed9f7712e basic_stream uses boost::shared_ptr 2019-02-14 12:54:32 -08:00
Vinnie Falco
ebc5246c47 Rewrite the echo-op example
fix #1450
2019-02-13 14:14:34 -08:00
Vinnie Falco
96b2944f70 Add detail::bind_continuation 2019-02-13 12:59:24 -08:00
Vinnie Falco
b6f215a00d handler binders use the associated allocator 2019-02-12 05:55:07 -08:00
Vinnie Falco
45d722874f Use tcp_stream, HTTP timeouts in advanced servers 2019-02-10 11:43:15 -08:00
Vinnie Falco
6ee1a88292 Use tcp_stream in WebSocket server examples 2019-02-10 11:42:01 -08:00
Vinnie Falco
920909673a Use tcp_stream in WebSocket client examples 2019-02-10 11:42:01 -08:00
Vinnie Falco
cab2472ee9 Use timeouts in HTTP client examples 2019-02-10 11:42:01 -08:00
Vinnie Falco
5b97fbb966 Use timeouts in HTTP server examples 2019-02-10 11:42:01 -08:00
Vinnie Falco
9b14774ada basic_stream subsumes stranded_stream:
* All functionality of stranded_stream is folded into basic_stream
* tcp_stream is an alias for basic_stream with tcp
* The tests are expanded to produce full coverage
* Timeout implementation is simplified
2019-02-10 11:42:01 -08:00
Vinnie Falco
0ce8ebbefd Fix posix_file::close handling of EINTR:
fix #1445

These changes optimize for Linux at the possible
expense of non-conforming platforms like HP-UX.
2019-02-10 05:52:12 -08:00
Vinnie Falco
168f674b4a Improved websocket stream documentation
fix #1213
2019-02-10 05:51:42 -08:00
Vinnie Falco
44ed20aa2c buffers_front tests 2019-02-09 06:58:59 -08:00
Vinnie Falco
b8aa6be7fd stranded_socket tests and tidy 2019-02-08 10:58:23 -08:00
Vinnie Falco
f15bbf10b4 flat_stream tests and tidy 2019-02-08 10:57:58 -08:00
Vinnie Falco
98834967c3 dynamic_buffer_ref tests and tidy 2019-02-08 10:57:41 -08:00
Daniel Sewtz
cd28598e5b Fixes to rfc7230:
fix #1435, fix #1438

* Example and test can be built on msvc v141 15.9.6
  using /std:c++17 and BOOST_BEAST_USE_STD_STRING_VIEW.

* changed string_view.to_string() to std:string(string_view),
  awaiting availability of Library Fundamentals TS here.

* Reactivated relevant tests to param_list. #ifdef 0 test
  exhibited same assertion failed error in debug mode.
  Now fixed in DEBUG on msvc v141 15.9.6 with
  BOOST_BEAST_USE_STD_STRING_VIEW and /std:c++17.

* Looked up http paramters (transfer-encoding, etc.)
  and changed tests as well as fixing comment to
  match specs.
2019-02-07 17:37:18 -08:00
Vinnie Falco
55d319a9d9 multi_buffer::clear preserves capacity 2019-02-07 17:37:18 -08:00
Vinnie Falco
c3125e8358 flat_buffer::clear preserves capacity 2019-02-07 17:37:18 -08:00
Vinnie Falco
27a6f57200 Add flat_stream:
flat_stream, previously in _experimental, is now a public API.
2019-02-07 17:37:18 -08:00
Vinnie Falco
3896f9aa9c Add stranded_stream 2019-02-07 17:37:18 -08:00
Vinnie Falco
812a19706a Improvements to test::stream:
The behavior of the test stream when either
end is destroyed or closed is well-defined.
2019-02-06 21:21:25 -08:00
Vinnie Falco
dc02f63050 close_socket is in stream_traits.hpp 2019-02-05 21:03:20 -08:00
Damian Jarek
34362256c0 Fixes to test::stream::async_read:
- Call the completion handler with the correct signature
- Replicate ASIO socket behavior of async operation completions
- Fix a data race between read_op and a call to stream::nread()

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-02-05 16:14:45 -08:00
Vinnie Falco
adcd4bc0c9 is_completion_handler, type_traits.hpp are deprecated (API Change):
* is_completion_handler is deprecated
* type_traits.hpp is a deprecated include

These items will be removed in the next version

* Include the new header file for the types needed:
  - stream_traits.hpp
  - file_base.hpp
* Use std::is_invocable instead of is_completion_handler
2019-02-05 14:16:30 -08:00
Vinnie Falco
8ea8f41bba is_file is in file_base.hpp (API Change):
* The metafunction `is_file` is part of file_base.hpp

Actions Required

* Include file_base.hpp as needed
2019-02-05 09:56:49 -08:00
Vinnie Falco
98aed8ed49 Fix hexadecimal string conversion table:
Defect discovered by PVS-Studio
2019-02-05 09:56:36 -08:00
Vinnie Falco
477cd75153 Stream traits are in stream_traits.hpp (API Change):
These metafunctions are moved from type_traits.hpp
to stream_traits.hpp:

- has_get_executor
- is_sync_stream
- is_sync_read_stream
- is_sync_write_stream
- is_async_stream
- is_async_read_stream
- is_async_write_stream

Actions Required:

* Include the file stream_traits.hpp as needed
2019-02-05 09:56:34 -08:00
Vinnie Falco
9cee4e053f Add executor_type trait 2019-02-05 07:46:09 -08:00
Vinnie Falco
42d83b221a Add stream_traits.hpp:
get_lowest_layer, lowest_layer_type are located here now.
2019-02-05 07:45:36 -08:00
Vinnie Falco
28858c60fd Better handling of stream timeouts 2019-02-04 07:26:02 -08:00
Vinnie Falco
b70966ad47 Fix stable_async_op_base javadoc 2019-02-03 17:17:59 -08:00
Vinnie Falco
9b88446ab8 Tidy up read implementation 2019-02-03 17:17:03 -08:00
Vinnie Falco
35dbd140d4 Add buffer_size 2019-02-03 12:59:11 -08:00
Vinnie Falco
64149f434a Refactor quickref.xml 2019-02-03 12:59:11 -08:00
Vinnie Falco
17ada67f0d Add dynamic_buffer_ref 2019-02-02 16:14:10 -08:00
Vinnie Falco
a142969c5d Qualify buffer_copy, don't qualify buffer_size:
fix #1416

* Calls to buffer_copy are qualified as net::buffer_copy
* Calls to buffer_size are made unqualified, permitting
  argument dependent lookup to take effect.
2019-02-02 13:01:27 -08:00
Vinnie Falco
5b0b218d96 test::stream maintains a handler work guard
fix #1418
2019-02-02 10:30:12 -08:00
Vinnie Falco
599104c16a async_echo supports move-only handlers
fix #1420
2019-02-02 10:20:38 -08:00
Peter Dimov
e0db595760 Faster http::string_to_field:
* Optimize hash calculation and equality for field strings

Experiments show the digest and equality functions taking the
most time. Optimizing L1 cache usage did not show significant
improvements.
2019-02-02 10:04:43 -08:00
Vinnie Falco
74f02f8ac5 Doc work 2019-02-01 14:05:07 -08:00
Vinnie Falco
49deee4a69 Add close_socket, beast_close_socket customization:
This algorithm allows a socket-like object to be closed in
a generic context. The customization point enables user-defined
types to define the close algorithm to use with `close_socket`.
2019-02-01 14:05:07 -08:00
Vinnie Falco
6a658b5c3a Remove lowest_layer, add get_lowest_layer (API Change):
fix #1417

* New get_lowest_layer free function works for any object
* New lowest_layer_type trait works for any object
* New examples and documentation on layered streams

API Changes:

* The member function lowest_layer is removed from all
  types provided by the library:

Actions Required:

* Call the free function get_lowest_layer instead of
  member lowest_layer.
2019-02-01 04:31:13 -08:00
Vinnie Falco
1da611fa04 Pass the correct handler in basic_timeout_stream 2019-01-22 21:25:06 -08:00
Vinnie Falco
60c96104ec lowest_layer is removed (API Change):
The nested function lowest_layer and nested type lowest_layer_type
are removed from all stream layers.

Actions Required:

* Remove lowest_layer and lowest_layer_type from user-defined streams.
* Use the get_lowest_layer free function and the lowest_layer_type trait
  as needed.
2019-01-22 04:59:07 -08:00
Vinnie Falco
383b9cb7f2 Send from the strand 2019-01-21 16:07:00 -08:00
Vinnie Falco
3081f52ad5 Add websocket-chat-multi example:
This is the multi-threaded io_context version of the
CppCon2018 WebSocket chat server and client example.
2019-01-21 12:13:04 -08:00
Vinnie Falco
9a8e22950f websocket stream uses shared_ptr<impl_type> 2019-01-21 08:44:14 -08:00
Vinnie Falco
944b5dcda7 Clear error codes idiomatically 2019-01-20 09:50:43 -08:00
Vinnie Falco
4d0849595c Add detail/prng.hpp 2019-01-20 07:05:16 -08:00
Vinnie Falco
785c0ad93d Add detail/soft_mutex.hpp 2019-01-20 07:05:16 -08:00
Vinnie Falco
d7cc7a6d1e Doc work 2019-01-20 07:05:16 -08:00
Vinnie Falco
4fcd6601b3 Doc work 2019-01-17 17:20:10 -08:00
Vinnie Falco
03bf9144b7 Unit test macros use the global suite
fix #1411
2019-01-17 17:19:00 -08:00
Vinnie Falco
72ea142c5c Add basic_timeout_stream:
This stream wrapper replaces basic_stream_socket and
provides just the timeout functionality.

* basic_stream_socket is removed
2019-01-17 17:18:31 -08:00
Andrey Semashev
03c2a8e54c Boost.System is header-only:
fix #1414

* No need to link with Boost.System
2019-01-15 11:45:31 -08:00
Vinnie Falco
ca5a70a3cd parse_until is not static
fix #1393
2019-01-15 11:42:05 -08:00
Vinnie Falco
b337abe076 examples use flat_buffer
fix #1401
2019-01-15 11:42:05 -08:00
Vinnie Falco
abb8203cbe session_alloc is thread-safe
fix #1408
2019-01-15 11:42:05 -08:00
Vinnie Falco
cf2dbdc0be Use new saved_handler in websocket 2019-01-15 11:42:05 -08:00
Vinnie Falco
3092e43879 saved_handler is a public interface:
This container allows completion handlers to be safely
suspended and resumed later, or destroyed.
2019-01-12 18:42:32 -08:00
Johan Rönnkvist
be800436ea Include error code in call to set_option 2019-01-12 13:14:33 -08:00
Vinnie Falco
3595eb2221 Update networking refresher doc 2019-01-12 13:11:00 -08:00
Vinnie Falco
3599ccb09a Add tests for async_op_base 2019-01-11 20:06:56 -08:00
Vinnie Falco
b4c63028e2 Add tests for bind_back_handler 2019-01-09 18:24:34 -08:00
Vinnie Falco
5292df6e72 async_op_base is a public interface:
This utility simplifies the authoring of composed
operations, see documentation for details.
2019-01-09 09:54:53 -08:00
Vinnie Falco
b46953f1bd Use async_op_base:
Composed operation implementations use async_op_base and
stable_async_op_base, to eliminate redundant boilerplate.
2019-01-09 09:54:42 -08:00
Vinnie Falco
9e44ae7be5 Refactor async_op_base:
* Renamed to async_op_base (was operation_base)
* Executor1 is explicit
* Add stable_async_op_base refinement
2019-01-09 09:54:15 -08:00
Vinnie Falco
522ca9e78b Tidy up basic_stream_socket docs 2019-01-09 09:54:05 -08:00
Vinnie Falco
0aa35d7266 Update coverage badge images 2019-01-09 09:53:53 -08:00
Glen Fernandes
1d5a18a0a1 Use cxxstd instead of cxxflags 2019-01-09 09:53:24 -08:00
Vinnie Falco
6caca92f0e New stream_socket:
This I/O object wraps an ordinary socket and provides a built-in
timeout and optional bandwidth rate-limiting facility.

Added class template basic_stream_socket

* Meets the requirements of AsyncReadStream and AsyncWriteStream

* Partially supports P1322R0:
  "Networking TS enhancement to enable custom I/O executors"
  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1322r0.html

  A strand or other io_context-compatible executor may be
  chosen to use for all asynchronous stream operations.

* Supports independent timeouts on logical operations:
  connect, read, write, or both read and write.

* Provides an option for a configurable rate limit
  limit on the maximum rates of reading or writing.

* The previous experimental implementation,
  `timeout_socket` and related types, is removed.

* stream_socket is an alias for basic_stream_socket which
  uses `net::ip::tcp` as its protocol.
2018-12-30 16:49:09 -08:00
Vinnie Falco
2d3912751b Add core errors and conditions 2018-12-30 12:51:34 -08:00
Vinnie Falco
7caa0b8132 Tidy up some buffer sequence iterators 2018-12-23 20:19:43 -08:00
Vinnie Falco
92e598ade3 Add bind_back_handler
fix #1384
2018-12-21 06:35:07 -08:00
Vinnie Falco
e7b8cc73a5 Decay bound arguments in handler wrapper parameters:
fix #1365

To reduce instantiations, the list of template parameters
to the bind and bind_front handler wrappers are decayed before
naming the class template.
2018-12-20 01:01:33 -08:00
Vinnie Falco
c4f4087888 Add buffers_range_ref (replaces reference_wrapper parameter) 2018-12-19 21:51:49 -08:00
Vinnie Falco
cbd5e76e92 Add type_traits tests 2018-12-19 21:51:49 -08:00
Vinnie Falco
002861bbc8 Adjust static_asio lib options in Jamfile 2018-12-19 21:51:49 -08:00
Vinnie Falco
9ccd8a754a HTTP tidying 2018-12-19 21:51:49 -08:00
Vinnie Falco
61a35bd936 Remove file_mode::append_new (API Change):
* Tidying
* Increase test coverage
* Fix file_mode::append_existing

API Changes:

* file_mode::append_new is removed, as it makes no sense

Actions Required:

* Replace file_mode::append_new with file_mode::append
  or file_mode::append_existing instead of file_mode::append_new
2018-12-19 21:51:49 -08:00
Vinnie Falco
321af29d25 Refactor static_buffer:
* Improve tests and coverage
* Add static_buffer_base::clear
* Use BOOST_BEAST_DECL
2018-12-19 20:59:20 -08:00
Vinnie Falco
0006ab3b2b make_printable replaces buffers rename (API Change):
* The function buffers is deprecated, use the new
  function make_printable as the replacement.

Actions Required:

* Replace call sites to use make_printable instead of buffers,
  and also include make_printable.hpp instead of ostream.hpp.
2018-12-19 20:59:20 -08:00
Vinnie Falco
991bae8486 Refactor ostream:
* Fix overflow
* Better calculation for prepare, no read_size
* Improve tests and code coverage
2018-12-19 20:59:20 -08:00
Vinnie Falco
594a92e515 Tidy up multi_buffer:
* Improved tests
* Refactor some declaration material
* basic_multi_buffer::clear is public

and

* Fix flat_buffer::reserve
* flat_buffer::clear is public
2018-12-19 20:59:20 -08:00
Vinnie Falco
74293fb8a5 Test self copy, self move for dynamic buffers:
* Swap
* Copy assignment to self
* Move assignment to self
2018-12-19 20:59:20 -08:00
Vinnie Falco
05d22802ec Tidy up flat_static_buffer tests 2018-12-19 20:59:20 -08:00
Vinnie Falco
81e3642fa7 Fix ostream prepare calculation for low limits:
This resolves an issue where the ostream could try to
exceeed the configured maximum size of a dynamic buffer
when the maximum is set to a very low number.
2018-12-19 20:59:20 -08:00
Vinnie Falco
b367776c37 Fixes and tidying for flat_buffer:
* Fix reserve() size calculation
* Improved test coverage
2018-12-19 20:59:20 -08:00
Vinnie Falco
477e5a6f98 Refactor buffers_suffix:
* Tidy up tests
* Increase code coverage
* Remove unnecessary move special members
* Correct behavior for default constructed iterators
2018-12-19 20:59:20 -08:00
Vinnie Falco
9d27f2659f Optimize for size on buffers_cat preconditions:
When BOOST_BEAST_TESTS is not defined, violations of
buffers_cat preconditions will assert instead of throwing
exceptions. This reduces the size of the emitted code
and improves performance.
2018-12-19 20:59:20 -08:00
Vinnie Falco
fa14af2696 Use new buffer traits, remove old unused traits 2018-12-19 20:59:20 -08:00
Vinnie Falco
8f1faababd Add buffers_iterator_type trait 2018-12-19 20:59:20 -08:00
Vinnie Falco
1998bad89d Add const and mutable buffer sequence traits:
* Add variadic is_const_buffer_sequence
* Add variadic is_mutable_buffer_sequence
* buffers_type is now variadic
2018-12-19 20:59:20 -08:00
Vinnie Falco
4cfe860b93 Refactor buffers_prefix:
* Tidy up tests
* Increase code coverage
* Correct behavior for default constructed iterators
2018-12-19 20:59:20 -08:00
Vinnie Falco
719fe66b77 Fix and refactor buffers_cat:
Elements of zero size are correctly skipped during iteration.

* Tidy up tests
* Increase code coverage
* Remove move special members
* Correct behavior for default constructed iterators
2018-12-19 20:59:20 -08:00
Vinnie Falco
ca728e4022 Refactor buffers_range:
* Add tests
* Increase code coverage
* Correct behavior for default constructed iterators
2018-12-19 20:59:20 -08:00
Vinnie Falco
117dda7b31 Refactor buffers_adaptor (API Change):
* Tidy up tests
* Increase code coverage
* Remove move special members
* Correct behavior for default constructed iterators

API Changes:

* buffers_adaptor is renamed (was buffers_adapter)

Actions Required:

* Replace buffers_adapter.hpp with buffers_adaptor.hpp, and
  replace buffers_adapter with buffers_adaptor. Or, define
  BOOST_BEAST_ALLOW_DEPRECATED
2018-12-19 20:59:20 -08:00
Vinnie Falco
c1d7a83af2 buffers_cat fixes and coverage:
* Fix operator== for default constructed iterators
* More tests and code coverage
2018-12-19 20:59:20 -08:00
Vinnie Falco
ad2cdf0281 Tidy up msvc-14 workaround in multi_buffer 2018-12-19 20:59:20 -08:00
Vinnie Falco
49c5f7c30f Don't include OpenSSL for core snippets 2018-12-19 20:59:20 -08:00
Vinnie Falco
b0f86ea001 Fix Appveyor badge links 2018-12-14 05:37:41 -08:00
Vinnie Falco
e17a92f2a8 Workarounds for msvc-14 2018-12-13 19:38:44 -08:00
Vinnie Falco
f0cbf8276e Tidy up bind_handler tests 2018-12-12 19:32:22 -08:00
Vinnie Falco
2afe929bb7 Fix bind_handler, bind_front_handler:
This tidies up small corner cases and bugs with
the bind_handler and bind_front_handler wrappers:

* Legacy allocation hooks are deleted
* Fixes for bind_front_handler specializations
* Decay bound arguments first, to reduce template instantiations
* Proper moving and forwarding of bound arguments and call parameters
2018-12-12 19:32:22 -08:00
Vinnie Falco
120d5481e2 Tidy up core files 2018-12-12 19:32:22 -08:00
Vinnie Falco
d8a23776d4 Tidy up experimental files 2018-12-12 19:32:22 -08:00
Vinnie Falco
0a583a331d Add buffer_traits.hpp, buffers_type 2018-12-12 19:32:22 -08:00
Vinnie Falco
b6eb988694 saved_handler maintains a work_guard (websocket):
* Tidy up and comment asserts

* `pausation` is renamed to saved_handler

* A work guard on the handler's associated executor
  is maintained for the lifetime of the store handler.
2018-12-12 19:32:22 -08:00
Vinnie Falco
8ea282ee5e flat_static_buffer improvements (API Change):
* Revise documentation
* Specify exception safety
* Mark more functions noexcept

API Changes:

* flat_static_buffer::reset is deprecated

Actions Required:

* Replace calls to flat_static_buffer::reset with
  flat_static_buffer::clear
2018-12-12 19:32:22 -08:00
Vinnie Falco
3e695d588a static_buffer improvements:
* Revise documentation
* Specify exception safety
* Mark more functions noexcept
2018-12-12 19:32:21 -08:00
Vinnie Falco
4fec064ad8 Files return errc::bad_file_descriptor (API Change):
fix #1356

* File functions return errc::bad_file_descriptor
  instead of errc::invalid_argument.

Actions Required:

* Callers checking for errc::invalid_argument from calls to
  file APIs should check for errc::bad_file_descriptor instead.
2018-12-12 19:32:21 -08:00
Vinnie Falco
8262405064 multi_buffer improvements:
fix #1345

* Revise documentation
* Add reserve() member
* Add max_size() member
* Add shrink_to_fit() member
* Respect Allocator max_size
* Specify exception safety
2018-12-12 19:32:21 -08:00
Vinnie Falco
11c71d118f flat_buffer improvements:
fix #1345

* Revise documentation
* Add reserve() member
* Add max_size() member
* Respect Allocator max_size
* Specify exception safety
2018-12-12 19:32:21 -08:00
Damian Jarek
776462a8a4 Use a struct instead of pair in flat_stream
No need to instantiate a pair and a custom struct has better member
names.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-12-06 15:53:13 -08:00
Vinnie Falco
35e4f321bc Refactor HTTP operations (API Change):
* Revise stream algorithm javadocs

* HTTP stream algorithms now use beast::read and
  beast::async_read with a custom completion condition.

API Changes:

* HTTP stream algorithms return the number of bytes transferred
  from the stream. Previously, they returned the number of bytes
  consumed by the parser.

Actions Required:

* Callers depending on the return value of http::read or
  http::async_read overloads should adjust the usage of
  the returned value as needed.
2018-12-06 15:50:26 -08:00
Vinnie Falco
c11682032b Crawler example clears the response before each read:
fix #1100

Unfortunately the example still seems to hang, tested
with 20 threads.
2018-12-06 15:50:24 -08:00
Brett Robinson
88eef1e9e3 Improvements to echo-op example:
close #1347

* Set SO_REUSEADDR in listener
* Use newline as the delimiter in async_read_until
* Add arg parsing and exit status to echo-op example
2018-12-03 17:08:40 -08:00
Damian Jarek
34037d538e Simplify handler_ptr:
Replace aligned_union in handler_ptr with the built-in one to reduce
the number of template instantiations and remove the reinterpret_casts
that were required.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-12-02 20:23:18 -08:00
Damian Jarek
587929edf6 Remove unused type_traits
close #1337

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-12-02 19:51:34 -08:00
Vinnie Falco
b3a8e6edb5 Tidy up calls to placement new 2018-12-02 19:48:42 -08:00
Vinnie Falco
7005f6b918 Documentation work 2018-12-02 17:52:04 -08:00
Vinnie Falco
773048c551 Simplify multi_buffer and static_buffer sequences 2018-12-02 17:52:01 -08:00
Vinnie Falco
f995fd41a3 net is a namespace alias for boost::asio:
The namespace alias beast::net replaces boost::asio in all code
and documentation.
2018-12-02 17:51:43 -08:00
Vinnie Falco
f18764424c Saved handlers are dispatched 2018-12-01 04:40:59 -08:00
Vinnie Falco
29cf6ce61f Dynamic buffers improvements:
fix #1305

Applies to:

    flat_buffer
    flat_static_buffer
    multi_buffer
    static_buffer

Changes:

* Revised all javadocs
* Move construction does not invalidate in some cases
* non-const data() returns a mutable buffer sequence
* Add cdata() to also return constant readable bytes
* Eligible member functions are declared noexcept
2018-11-30 13:46:56 -08:00
Brett Robinson
eb588ff82c Tidy up ssl_stream (experimental):
fix #1323, close #1328

* Fix whitespace
* Remove ssl::context pointer
* Use implicit move ctor and assignment operator
2018-11-28 13:46:40 -08:00
Vinnie Falco
49cdabca19 Add net namespace alias 2018-11-27 10:24:24 -08:00
Vinnie Falco
2b16c50321 http::async_read returns the right byte count on error
fix #1223
2018-11-27 10:09:19 -08:00
Damian Jarek
8930d437b5 Enable explicit instantiation of websocket::stream:
fix #1279, close #1319

This enables users to improve compilation performance by explicitly
instantiating the stream template in another TU.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-26 18:38:09 -08:00
Damian Jarek
650ddd07c1 Tidy up test::stream:
fix #1308, close #1321

* test::stream will no longer include asio::tcp::ip transitively.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-26 16:04:00 -08:00
Damian Jarek
836042fd24 Fix test::stream async_result transformation:
close #1322

async initiating functions must return init.result.get(). Returning the
result of post caused a compilation failure for custom completion tokens.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-26 16:02:44 -08:00
Brett Robinson
f8b3ae1186 Update ssl_stream signatures for networking changes
fix #1247, close #1323
2018-11-26 16:00:58 -08:00
Vinnie Falco
e57c74b56c
Set version to 192 2018-11-26 15:30:53 -08:00
Vinnie Falco
02fb4983f6 Fixes to timeout services (experimental) 2018-11-26 15:30:49 -08:00
Vinnie Falco
cd07e5bce8 Fix link in docs
fix #1296
2018-11-26 15:30:49 -08:00
Vinnie Falco
2cdaf51119 http::message is not-a boost::empty_value
fix #1306
2018-11-26 15:30:48 -08:00
Vinnie Falco
5bff4ed8ab Tidy up warnings and deprecated usage:
fix #1290

* BOOST_ASIO_NO_DEPRECATED=1 is now set
* Fix various warnings from the Boost regression test matrix
* Fix a bug in advanced servers when checking for a timeout
2018-11-26 15:30:48 -08:00
Damian Jarek
c0e5d1bd76 Use mp11::integer_sequence
Close #1317

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-26 15:30:48 -08:00
Vinnie Falco
c0695db877 Merge master into develop 2018-11-26 15:26:51 -08:00
Vinnie Falco
320037a6bc
Set version to 189-hf1 2018-11-26 12:19:22 -08:00
Vinnie Falco
a5d5c7500a example/cppcon2018 only requires C++11 2018-11-26 12:04:35 -08:00
Vinnie Falco
cf6021a355 Fix broken doc link 2018-11-26 12:04:03 -08:00
Vinnie Falco
7b93cca28a example/cppcon2018 only requires C++11 2018-11-22 18:34:25 -08:00
Vinnie Falco
e0b3aa7745 Fix warning in is_ssl_handshake 2018-11-22 18:34:09 -08:00
Vinnie Falco
2585625459 Fix static_string uninitialized warning 2018-11-22 08:08:55 -08:00
Damian Jarek
b9eb1d75d9 Fix buffers_cat uninitialized warning
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-22 08:07:10 -08:00
Damian Jarek
13322fa4bb Use mp11 in detail::variant
Reduce compilation cost for all components dependent on variant.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2018-11-22 07:39:26 -08:00
Damian Jarek
98ff568371 Use lean_tuple in bind_handler, bind_front_handler 2018-11-21 12:47:59 -08:00