127 Commits

Author SHA1 Message Date
Vinnie Falco
6c9e9ea243 Tests are fat binaries 2022-05-21 22:12:13 -07:00
Richard Hodges
b5a94db2a5 WebSocket handshake response is deterministic on failure:
Add test for websocket handshake failure HTTP response

fix #2364
close #2365
2021-12-22 12:00:17 +01:00
Richard Hodges
355dcfe502 Add individual tests to CMake workflow
close #2350
2021-12-09 14:27:18 +01:00
Richard Hodges
7257d64a21 WebSocket test is deterministic 2021-04-06 19:24:51 +02:00
Richard Hodges
c3e83439dd Fix incorrect websocket test ordering 2021-03-29 12:17:23 +02:00
dmorilha-twilio
8283a7df3f Fix case where inflated content is larger than out buffer
closes #2191
2021-03-25 14:47:10 +01:00
Richard Hodges
fae4c0e3c2 Parenthesise all uses of min() and max() 2021-03-16 10:02:47 +01:00
Richard Hodges
8913a3cd21 Add executor rebind to test::stream
closes #2139
2020-12-16 21:11:29 +01:00
Richard Hodges
a9b5bf343d Examples require tracked 2020-07-04 08:22:57 +02:00
Richard Hodges
060f59685c Support BOOST_ASIO_NO_TS_EXECUTORS 2020-07-04 07:35:14 +02:00
Christopher Kohlhoff
55302a3f8f New name for polymorphic executor. Trait for detecting new executors 2020-07-04 07:34:34 +02:00
Richard Hodges
d016ff52af Fix all async initiating functions with use_awaitable:
Add trait:
    is_completion_token_for

Fixes for
    buffered_read_stream

Add tests for
    basic_stream
    buffered_read_stream
    flat_stream
    http (all)
    websocket (all)

resolves #1920
2020-04-28 20:48:00 +02:00
Cristian Morales Vega
26a156e300 Fix async_close error code when async_read times out
close #1754
2019-11-02 08:26:23 -07:00
Vinnie Falco
bafce23853 Squelch spurious websocket timer assert 2019-10-09 12:00:22 -07:00
Vinnie Falco
0f932d589b Silence unused variables 2019-10-04 18:57:48 -07:00
Vinnie Falco
9f77867f0a Fix outgoing websocket message compression
fix #1666
2019-07-29 10:35:41 -07:00
Damian Jarek
5f0939e771 Simplify websocket::detail::prng:
- Use a regular function pointer for dynamic dispatch.
- Remove `prng::ref` - it did not benefit the default case
  (TLS avaialable) and actually made the no-TLS case slower, because
  the time spent in the generator is dominated by mutex locking.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-07-01 12:49:01 -07:00
Damian Jarek
a5a28c3b7d Fix UB in websocket read tests
An object returned from a function is not guaranteed not to be copied
in C++14 or earlier, using `initializer_list` removes the reliance on
RVO to work.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-25 20:00:33 +02:00
Damian Jarek
86176786c3 Expand CI matrix using Azure Pipelines:
* Allow setting a seed in websocket prng to workaround a valgrind bug
  in Xenial.
* Coverage collection in Azp.
* Fixup blacklists to avoid zlib bugs.
* Use native b2 features for sanitizers and valgrind.
* Expanded Windows build matrix.
* Add additional clang (with libc++) builds.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-19 22:32:44 +02:00
Damian Jarek
cefb744794 Remove uses of deprecated methods in websocket tests
This enables tests to be built without BOOST_BEAST_ALLOW_DEPRECATED.

Close #1612

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-19 22:32:43 +02:00
Vinnie Falco
6be11913a0 Add idle ping suspend test
close #1599
2019-05-04 18:47:37 -07:00
Damian Jarek
16631de5d9 Fix UB in websocket close tests
Extend the lifetime of buffers in tests to avoid use-after-free.

Resolves: #1593

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-04 17:29:43 +02:00
Vinnie Falco
7c084509d6 decorator constructor is constrained 2019-04-02 16:49:05 -07:00
Vinnie Falco
61fcd9ef6f Refactor Jamfiles to work with release layout 2019-03-24 09:18:02 -07:00
Vinnie Falco
b38901887b cmake: Use static libs to speed up builds 2019-03-23 17:50:38 -07:00
Damian Jarek
222dcf7b18 Jamfile cleanup:
- Don't set the global link settings (`<link>`) to avoid dependency
ordering issues in the future.
- Allow the user to decide on the link settings for dependencies
(filesystem/coroutine).
- Make dependencies in examples explicit.
- Remove dependency of examples on Boost.Filesystem (was not used there).
- Deduplicate build settings.
- Speed up test compilation by avoiding rebuilding of main test file.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-21 17:23:49 +01: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
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
e4342b51b2 SSL teardowns are in an associated namespace 2019-03-04 18:33:24 -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
4eb137f8ea Fix decorator for certain sizes 2019-03-03 17:13:56 -08:00
Vinnie Falco
62878255fb Workaround for msvc-14.0 2019-03-03 12:52:35 -08:00
Vinnie Falco
fca4b3ae10 make_strand is in net:: 2019-03-02 07:33:57 -08:00
Vinnie Falco
974f34beab Tidy up a warning and test 2019-02-27 18:15:07 -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
8f9eed1faf stream_base::timeout::suggested is a nested function 2019-02-27 06:52:45 -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
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
955354b9dd Enable split Beast compilation for tests 2019-02-22 17:27:27 -08:00
Vinnie Falco
6ada618c12 Check BOOST_NO_CXX11_THREAD_LOCAL 2019-02-21 11:09:02 -08:00
Vinnie Falco
c681241d70 Large WebSocket Upgrade response no longer overflows
fix #1460
2019-02-20 18:58:59 -08:00
Vinnie Falco
28d3b41a43 websocket idle pings 2019-02-20 07:12:36 -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
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
f21358186e Add websocket::stream timeouts 2019-02-18 12:18:27 -08:00