Commit Graph

1313 Commits

Author SHA1 Message Date
Vinnie Falco
71de05d3cc More std::string_view fixes 2019-04-18 16:15:42 -07:00
Vinnie Falco
00603397a9
Set version to 251 2019-04-15 08:22:08 -07:00
Damian Jarek
2cfe3ba1b8 Replace static_string in parser
close #1574

This change yields a modest performance improment of 1-2% by replacing
the exception-based handling of buffer overflow with one based on
regular conditional checks.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-04-15 08:21:48 -07:00
Damian Jarek
b7a8fb5178 Fix compilation on MSVC with std::string_view
close #1573

std::string_view::iterator is not necessarily a raw pointer.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-04-15 08:21:48 -07:00
Damian Jarek
8703038e37 launder pointers:
close #1570

`std::launder` must be used whenever placement-new of an unknown type
is performed and the result of the placement-new expression is discarded.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-04-15 08:21:48 -07:00
Vinnie Falco
0345aa194d
Set version to 250 2019-04-11 12:18:10 -07:00
Mohamed El Housseine
ebe52537ea Set parser status and flags even if body_limit_ has been reached
close #1556
2019-04-08 17:14:46 -07:00
Damian Jarek
bc9f63f10d Cleanup endianness conversions:
close #1544

- Use Boost.Endian conversions functions.
- Remove existing private conversion functions.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-04-08 17:14:04 -07:00
Vinnie Falco
5e88637752
Set version to 249 2019-04-08 15:13:46 -07:00
Vinnie Falco
1de60a0462 Move friend function template definition 2019-04-08 15:13:12 -07:00
Vinnie Falco
b701d72ddb
Set version to 248 2019-04-06 13:24:56 -07:00
Simon Ebner
7e78863074
Don't use a moved-from handler:
close #1560

* Obtain the executor from the handler prior
  to transferring ownership.
2019-04-06 13:23:12 -07:00
Vinnie Falco
ea40d0262a
Set version to 247 2019-04-05 05:09:09 -07:00
Damian Jarek
ce986118f8
Fix async_base immediate completion
`complete(false, ...)` used the wrong executor when an async operation
completed immediately, potentially executing the completion handler on
the IO executor in some cases.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-04-05 05:08:31 -07:00
Vinnie Falco
50d5b965dd
Set version to 246 2019-04-03 11:16:52 -07:00
Vinnie Falco
90d7434847 decorator ctor is explicit 2019-04-03 11:16:38 -07:00
Vinnie Falco
15256f5ea7
Set version to 245 2019-04-02 16:49:09 -07:00
Vinnie Falco
7c084509d6 decorator constructor is constrained 2019-04-02 16:49:05 -07:00
Vinnie Falco
a4974e18ba
Set version to 244 2019-04-02 05:28:13 -07:00
Vinnie Falco
8ec1a4d90f Fix websocket keep-alive ping expiration 2019-04-01 18:14:25 -07:00
Vinnie Falco
27c572fbfa Tidy up declval in some traits 2019-04-01 17:35:44 -07:00
Vinnie Falco
d8bc714030
Set version to 243 2019-03-30 14:15:02 -07:00
Denis Glazachev
058294e908 Fix http::message constructor constraint 2019-03-30 14:14:59 -07:00
Vinnie Falco
4f464ccaeb Tidy up file_stdio for VS2015 2019-03-30 14:14:59 -07:00
Denis Glazachev
24ccdd243a Fix some typos 2019-03-30 11:12:04 -07:00
Vinnie Falco
658e678673 Set version to 242 2019-03-29 20:42:44 -07:00
Vinnie Falco
4e90183bda Check defined(BOOST_MSVC) 2019-03-29 20:42:44 -07:00
Vinnie Falco
a7faf03694 Fix http::message constructor constraint 2019-03-29 20:42:44 -07:00
Vinnie Falco
965c21615a MSVC uses ::fopen_s 2019-03-29 20:42:44 -07:00
Vinnie Falco
3c82717fed test::stream has deprecated lowest_layer for ssl 2019-03-29 17:31:18 -07:00
Vinnie Falco
b39a297b41
Set version to 241 2019-03-29 15:05:38 -07:00
Vinnie Falco
51db4d491a basic_parser::content_length is stable (API Change):
fix #1375

* The value returned from `basic_parser::content_length`
  no longer changes as the body of the message is received.

Actions Required:

* Call `basic_parser::content_length_remaining` instead
  of `basic_parser::content_length`.
2019-03-29 15:05:30 -07:00
Vinnie Falco
5154233350
Set version 240 2019-03-27 09:13:53 -07:00
Vinnie Falco
ed9d861545 Fix ssl_stream teardown 2019-03-27 09:13:32 -07:00
Vinnie Falco
2c141cd4ad
Set version to 239 2019-03-24 11:05:28 -07:00
Damian Jarek
5a0b4d7ebe More split compilation in HTTP
close #1541

- Remove unused private functions: `skip_ows_rev`, `skip_obs_fold`.
- Enable split compilation in `http/detail/rfc7230.hpp`.
- More split compilation in `basic_parser`.
- Remove some unnecessary includes.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-24 11:05:24 -07:00
Vinnie Falco
b95bd46b49
Set version to 238 2019-03-24 09:18:06 -07:00
Vinnie Falco
61fcd9ef6f Refactor Jamfiles to work with release layout 2019-03-24 09:18:02 -07:00
Vinnie Falco
4e82719640
Set version to 237 2019-03-23 17:50:49 -07:00
Vinnie Falco
b01d692ad7
Set version to 236 2019-03-22 10:09:32 -07:00
Vinnie Falco
f5d08d7b2c Set version to 235 2019-03-21 17:23:49 +01:00
Vinnie Falco
1f18b2712c
Set version to 234 2019-03-19 12:31:39 -07:00
Vinnie Falco
0c3ca62590
Set version to 233 2019-03-14 12:13:18 -07:00
Damian Jarek
8869ec5681
Use secure TLS/SSL versions:
TLS1.2 can be used instead, it is available in all currently
supported versions of OpenSSL.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-14 09:56:50 -07:00
Gregor Jasny
0033b7c1e4
Android: Use compiler pre-defined __ANDROID__
The ANDROID define us usually originationg from he build system
(like CMake, ndk-build, etc.). But some buildsystems like Bazel
do not set it which brakes Android platform detection.

Better use __ANDROID__ (like boost predef does) which is
predefined by the compiler if targeting Android.
2019-03-14 09:55:22 -07:00
Vinnie Falco
fdfd666e23
Set version to 232 2019-03-13 06:48:44 -07:00
Vinnie Falco
fdc83c981b Fix basic_stream lowest_layer for ssl 2019-03-12 18:58:24 -07:00
Vinnie Falco
b7c3c1eb1a Fix file_win32_write_op async initiation 2019-03-12 18:07:19 -07:00
Vinnie Falco
554701845c Fix close_socket for net::basic_socket changes 2019-03-12 16:20:36 -07:00
Vinnie Falco
3c878479d0
Set version to 231 2019-03-12 13:44:51 -07:00
Vinnie Falco
cfbdce3e5c Constrain to_static_string to integers 2019-03-12 13:44:48 -07:00
Vinnie Falco
30d1972aa2 Add missing include 2019-03-11 13:24:20 -07:00
Vinnie Falco
44f37d1a11
Set version to 230 2019-03-10 13:23:26 -07:00
Damian Jarek
dc52df351a Enable more split compilation in websocket and http
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-10 13:23:22 -07:00
Vinnie Falco
d2041c0322 Doc tidying 2019-03-08 09:33:52 -08:00
Damian Jarek
b9aad3d06c Fix completion handler invocation signatures
Completion handlers should be called with the exact same signature as
provided to `async_result`.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-07 12:56:40 -08:00
Vinnie Falco
fdf64a4550 Remove dynamic_buffer_ref:
* dynamic_buffer_ref is removed, because Asio / Networking
  has introduced the DynamicBuffer_v2 concept which is incompatible
  with Beast's storage types.

The next version of Beast (1.70) will provide changes to
interoperate with Asio / Networking's new concepts.
2019-03-07 12:56:40 -08:00
Vinnie Falco
f4e2a327c8 Don't use dynamic_buffer_ref 2019-03-07 12:56:40 -08:00
Vinnie Falco
79e6c61db5
Set version to 229 2019-03-06 11:52:52 -08:00
Vinnie Falco
06a42f2202 Fix stable_async_base example 2019-03-06 10:38:08 -08:00
Vinnie Falco
45353a7f04 handler_ptr is deprecated (API Change):
* `handler_ptr` is deprecated and should not be used.

Actions Required:

* Replace use of `handler_ptr` with `stable_async_base`
  and `allocate_stable`.
2019-03-06 10:38:08 -08:00
Vinnie Falco
7f53b0f66c detect_ssl returns a bool
fix #1288
2019-03-06 05:50:22 -08:00
Vinnie Falco
e073a9e7fc Tidy up docs 2019-03-05 20:15:07 -08:00
Vinnie Falco
9f2b0ce1db Rename to buffer_bytes 2019-03-05 11:09:53 -08:00
Vinnie Falco
6ccdcdf51d buffer_size is in buffer_traits.hpp 2019-03-05 11:09:50 -08:00
Vinnie Falco
8e2620e2b1 Doc tidy 2019-03-05 08:00:14 -08:00
Vinnie Falco
31331bbe4d
Set version to 228 2019-03-04 18:33:27 -08:00
Vinnie Falco
e4342b51b2 SSL teardowns are in an associated namespace 2019-03-04 18:33:24 -08:00
Vinnie Falco
75c3ca622f Sync up convenience headers 2019-03-04 14:44:31 -08:00
Damian Jarek
8f83b4e611 Fix UB in decorator:
- don't assume layout or size overhead of classes with
  virtual members (use split vtable)
- don't use SOO for types with throwing move

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-04 14:44:15 -08:00
Vinnie Falco
dc239fbb39 Set version to 227 2019-03-03 20:28:54 -08:00
Vinnie Falco
0e4e7ff370 ~basic_parser is virtual 2019-03-03 19:31:52 -08:00
Vinnie Falco
4eb137f8ea Fix decorator for certain sizes 2019-03-03 17:13:56 -08:00
Vinnie Falco
1e5b4f531d
Set version to 226 2019-03-03 13:36:36 -08:00
Eelis van der Weegen
9992701a4a Fix ubsan false positive:
* Avoid calling stream() on partially constructed object.

Fixes #1495, fix #1496
2019-03-03 13:36:31 -08:00
Vinnie Falco
62878255fb Workaround for msvc-14.0 2019-03-03 12:52:35 -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
cec63d923c Tidy up appveyor error 2019-03-02 07:33:57 -08:00
Vinnie Falco
fca4b3ae10 make_strand is in net:: 2019-03-02 07:33:57 -08:00
Damian Jarek
c7a7d16992 Allow the use of string_body and vector_body with -fno-exceptions
`string_body` and `vector_body` will no longer translate all exceptions
to "buffer_overflow" error code. `buffer_overflow` error can now only
occur if the Body's max_size() is exceeded.

Changes required:
Code that relies on exceptions thrown from value_type's reserve/resize
being translated into an error code must implement a mechanism to catch
the exception.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-01 14:50:50 -08:00
Vinnie Falco
8c53abe6e5 Support -fno-exceptions 2019-03-01 13:52:50 -08:00
Vinnie Falco
723fceaf67
Set version to 225 2019-03-01 12:02:47 -08:00
Vinnie Falco
a3f0ea3573 Move macro from config.hpp 2019-03-01 10:47:09 -08:00
Vinnie Falco
df93a8dbf1
Set version to 224 2019-02-28 11:43:15 -08:00
Vinnie Falco
00487f1de6 Reusing an HTTP parser returns an error 2019-02-28 10:27:43 -08:00
Vinnie Falco
f611807bc0
Set version to 223 2019-02-27 18:15:11 -08:00
Vinnie Falco
ef5282ebcf Tidy up websocket service 2019-02-27 16:44:04 -08:00
Vinnie Falco
92ad50a8e7 Destroy abandoned websocket ops on shutdown
fix #1358
2019-02-27 16:44:01 -08:00
Vinnie Falco
031e13c253 Add websocket service 2019-02-27 16:42:19 -08:00
Vinnie Falco
05b5843e19 Next layer is a base class 2019-02-27 14:48:31 -08:00
Vinnie Falco
c510662c67 Add test::stream::service 2019-02-27 14:05:16 -08:00
Vinnie Falco
5af7ad2e15
Set version to 222 2019-02-27 07:01:42 -08:00
Vinnie Falco
22b6fa4121 Reduce instantiations in detect_ssl 2019-02-27 06:54:55 -08:00
Vinnie Falco
d0cf40d5b2 Fix as-if post 2019-02-27 06:53:22 -08:00
Vinnie Falco
8f9eed1faf stream_base::timeout::suggested is a nested function 2019-02-27 06:52:45 -08:00
Vinnie Falco
b02f59ff91
Set version to 221 2019-02-26 07:21:15 -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
Damian Jarek
e9ba521c60 Cleanup in test::stream internals:
* avoid one instantiation of `bind_handler_front`
* avoid going through the 2-arg post unnecessarily in `read_op`

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-02-26 07:20:48 -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
28eecefaaa
Set version to 220 2019-02-24 19:44:12 -08:00
Vinnie Falco
d9400ce618 Refactor docs 2019-02-24 18:46:27 -08:00
Vinnie Falco
3038234376
Set version to 219 2019-02-23 12:07:39 -08:00
Vinnie Falco
f92999b613 Doc work 2019-02-23 12:04:48 -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
d4dddec1c0 Reduce template instantiations 2019-02-23 08:56:57 -08:00
Vinnie Falco
46eb006757 Tidy up docs 2019-02-22 19:46:29 -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
c82237512a
Set version to 218 2019-02-22 17:27:33 -08:00
Vinnie Falco
955354b9dd Enable split Beast compilation for tests 2019-02-22 17:27:27 -08:00
Vinnie Falco
c5af2e7fcc Fixes to some CI targets 2019-02-22 15:39:34 -08:00
Vinnie Falco
90b783cb62 detect_ssl, async_detect_ssl are public interfaces 2019-02-22 15:39:34 -08:00
Vinnie Falco
b2807ae3ee
Set version to 217 2019-02-21 13:19:43 -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
e2d3f741b8 Fix compile errors 2019-02-20 22:37:00 -08:00
Vinnie Falco
eea3929b26 Concept check tidying 2019-02-20 19:19:59 -08:00
Vinnie Falco
2b92189b65 Doc tidying 2019-02-20 19:09:21 -08:00
Vinnie Falco
c681241d70 Large WebSocket Upgrade response no longer overflows
fix #1460
2019-02-20 18:58:59 -08:00
Vinnie Falco
51994d133f Release notes 2019-02-20 18:58:59 -08:00
Vinnie Falco
b7f2792062 Fix file_body_win32
fix #1464
2019-02-20 15:30:03 -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
093f966f69 Disable bind_continuation 2019-02-20 15:30:02 -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
a5adc328e4 basic_stream uses async_initiate 2019-02-19 16:27:27 -08:00
Vinnie Falco
c5b655c954 basic_stream connects are members 2019-02-19 16:27:27 -08:00
Vinnie Falco
0ad7390e94 Use async_initiate in basic_stream 2019-02-19 16:27:26 -08:00
Vinnie Falco
23a7bcc67e Add RatePolicy to basic_stream 2019-02-19 16:23:30 -08:00
Vinnie Falco
6baa607295 Fixes to support Asio changes (API Change):
This adjusts Beast's interfaces and implementation to match
the changes in Boost.Asio.
2019-02-19 16:23:30 -08:00
Vinnie Falco
ac24e58fb3 Add make_strand 2019-02-19 16:23:30 -08:00
Vinnie Falco
bc436da9c5 Documentation work 2019-02-19 16:23:30 -08:00
Vinnie Falco
3f50efa138 WebSocket Decorator is a socket option (API Change):
This changes the interface used to apply a decorator to the HTTP
request or response messages used to perform the WebSocket handshake
as follows:

* Add the `stream_base::decorator` option object

* Add `stream::set_option` overload to set the decorator from
  the option

* The decorator applies to all client and server handshakes
  performed on the stream after the option is set.

* Overloads of the following functions which accept a Decorator
  are deprecated:
  - accept, accept_ex
  - handshake, handshake_ex
  - async_accept, async_accept_ex
  - async_handshake, async_handshake_ex

Actions Required:

* Code which passes decorator to any `websocket::stream` member
  function should call `stream::set_option` instead with a newly
  constructed `stream_base::decorator` object containing the
  decorator. Alternatively, the macro `BOOST_BEAST_ALLOW_DEPRECATED`
  may be defined to 1.
2019-02-19 16:23:30 -08:00
Vinnie Falco
085fb66b26 websocket test coverage 2019-02-18 12:18:27 -08:00
Vinnie Falco
e831e8b7ee Add detail::decorator 2019-02-18 12:18:27 -08:00
Vinnie Falco
79c777e776 Tidying and fixes 2019-02-18 12:18:27 -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
9f8cf7d599
Set version to 215 2019-02-16 15:09:38 -08:00
Vinnie Falco
5c01953076 Remove unused file 2019-02-16 15:09:35 -08:00
Vinnie Falco
2e62f25701 Use async_op_base::invoke 2019-02-16 15:09:34 -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