Commit Graph

732 Commits

Author SHA1 Message Date
AeroStun
d895906bcc
Refactor zlib tests and fix typo:
close #1744

* Fixed typo in enum name
* Added missing zlib error enumerator
* Marked caveat in zlib impl to avoid future confusion
* Created Compressor/Decompressor abstractions in Beast.zlib tests
* Applied abstractions on Beast.zlib tests
* Workaround Travis-CI' 10min silence timeout
* Add test for Beast.zlib's need_dict error
* Avoid breaking user-code dependant on deprecated enumerator interface

Signed-off-by: AeroStun <24841307+AeroStun@users.noreply.github.com>
2019-11-02 08:29:30 -07: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
Roel Standaert
dcc30bcc40 https_get example sends the Host header:
close #1751

If you try the https_get example with the Server header, servers will
respond with 400 Bad Request. This example works as it should when it
uses the Host header.
2019-11-02 08:26:06 -07:00
Vinnie Falco
21137f2708 Disable broken tests 2019-10-31 06:49:55 -07:00
Vinnie Falco
9f468ec1c1 Use automatically deduced return types for all async operations:
C++14 or later is required to support completion tokens that use
per-operation return type deduction. For C++11, a completion
token's async_result specialisation must still provide the nested
typedef `return_type`.
2019-10-31 06:47:22 -07:00
Vinnie Falco
7cc8759261 Async init-fns use the executor's default token 2019-10-31 05:47:05 -07:00
Peter Jankuliak
1abe92f524 Fix leftovers in basic_parser corner case:
fix #1734, close #1736

buf_.get() has size `buf_len_`, but only `size` number of octets in that
buffer is valid.
2019-10-18 05:30:29 -07:00
Vinnie Falco
087bcc4ef5 Use the executor type in basic_stream timer
fix #1589
2019-10-15 15:48:42 -07:00
Vinnie Falco
bafce23853 Squelch spurious websocket timer assert 2019-10-09 12:00:22 -07:00
AeroStun
37f75773ef Added missing error handling in deflate stream test
Signed-off-by: AeroStun <24841307+AeroStun@users.noreply.github.com>
2019-10-07 12:46:39 -07:00
AeroStun
dbdf49e313 Added missing header inclusions in deflate stream test
Signed-off-by: AeroStun <24841307+AeroStun@users.noreply.github.com>
2019-10-07 12:46:39 -07:00
AeroStun
5984212e77 Silence integer narrowing in inflate stream tests
Signed-off-by: AeroStun <24841307+AeroStun@users.noreply.github.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
2ce0a10a01 Add a known string to the inflate matrix
This makes coverage slightly more stable coverage and covers some
additional lines.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
c76ef3bf31 Test flush after emitting a dist code
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
fd57b0a73d Test for match length exceeding lookahead in deflate stream
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
3d9ee6acee Add test for flush when literal buffer is full
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
85ab7a3fd0 Add test for partial flush in deflate stream
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
01c200d2ef Add test checking for writes into a stream in finished state
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
d785666738 Fix nontrivial memeset initialization warning in zlib bench tests
GCC complains about initialization of a non-trivial object with memset,
`z_params` is non-trivial because of non-static data member initializer.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
d1ff4405aa Add test for flush::trees with uncompressed strategy
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
0b8c285bb7 Add test for flush::trees with fixed Huffman strategy
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
3b585f660c Add excess data inflate test
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
610a2681e4 Throw on invalid argument
This condition is a programmer error, so reporting it as a regular
error is confusing.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
11ee655f97 Expand deflate matrix to check for different memLevel values
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:39 -07:00
Damian Jarek
8ee65054a6 Add success test cases from zlib test suite
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:38 -07:00
Damian Jarek
b0aa3df714 Import more failure test cases from zlib test suite
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:38 -07:00
Damian Jarek
5937c06cd0 Add test for invalid inflate stream settings
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:38 -07:00
Damian Jarek
4be185eb2b Add test for invalid deflate stream settings
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:38 -07:00
Damian Jarek
84bf4c5362 Add failure test cases from zlib's inflate test suite
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-07 12:46:38 -07:00
Vinnie Falco
0f932d589b Silence unused variables 2019-10-04 18:57:48 -07:00
Vinnie Falco
5f9c14af2e Fix typo 2019-10-04 18:48:09 -07:00
Vinnie Falco
9efa3fd1c3 Add test for issue 1717 2019-10-04 06:09:50 -07:00
Mike Ellery
e681f9d212 Add default dtors to satisfy -Wnon-virtual-dtor
close #1664
2019-08-29 10:52:07 -07:00
Vinnie Falco
9f77867f0a Fix outgoing websocket message compression
fix #1666
2019-07-29 10:35:41 -07:00
Damian Jarek
373642886a Workaround for miscompilation in MSVC 14.2
`insert()` erroneously produces the string "12__343" in
Release mode on MSVC 14.2.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-07-08 20:37:42 +02:00
Damian Jarek
2c2ac8027c Fix unused variable warnings in tests
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-07-08 20:28:58 +02:00
Damian Jarek
63ef7f65bc Handle overflow in max size calculation in basic_dynamic_body
fix #1581

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-07-08 20:28:49 +02:00
Vinnie Falco
67452b23ff Update documentation 2019-07-07 12:29:56 -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
7e8af58307 Move detail::base64 helpers to tests
These functions were only used in tests.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-24 11:07:41 -07:00
Damian Jarek
b8b04f8f39 Cleanup transitive includes in beast/core/detail/type_traits.hpp
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-24 11:07:41 -07:00
Damian Jarek
8d5bd286d7
Replace uses of net::spawn with asio::spawn
`asio::spawn` is an extension, which is not part of
the Networking TS, so the `net` alias is not appropriate in this case.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:35 +02:00
Damian Jarek
d5f5f1467f
Enable split compilation in http::basic_fields
Moved functions,that are independent of template argument, into
an *.ipp file.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:33 +02:00
Damian Jarek
833243d948
Remove the use of static_string from http::fields
The `temporary_buffer<A>` class template replaces the use of
`static_string` in `http::fields`, simplifying `set_chunked_impl` and
`set_keep_alive_impl`.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-04 15:31:18 +02:00
Damian Jarek
fce080f1a8
Add VS 2019 AzP CI matrix item
The VS 2019 image now includes vcpkg by default, which enables adding
it to CI.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-31 20:11:38 +02:00
Damian Jarek
a094e7d891
Remove redundant use of yield_to in parser tests
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-31 02:04:36 +02:00
Vinnie Falco
e9781b225e
Fix flat_buffer copy members
fix #1621
2019-05-29 21:14:14 +02:00
Damian Jarek
2eedbfedfc
Add b2 features for compile-time options used in testing:
- `boost.beast.allow-deprecated=on` disables deprecated features.
- `boost.beast.separate-compilation=on` enables separate compilation.
- Add CI matrix items to check header-only, no-deprecated build.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-27 20:18:20 +02:00
Damian Jarek
85adb6ca2f
Fix buffers_cat iterator tests
The default constructed iterators tests were never run.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-20 15:34:20 +02:00