Commit Graph

1309 Commits

Author SHA1 Message Date
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
f10dc38ae6
Replace uses of net::coroutine with asio::coroutine
`asio::coroutine` 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
a0d5baf22a
Improve performance of http::string_to_verb
`operator==` performs better than the hand-written comparison routine.

fix #1636

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:35 +02:00
Damian Jarek
ab55c4d21e
Fix coverage collection in AzP
https://github.com/boostorg/build/pull/449

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:35 +02:00
Damian Jarek
da61b4e52c
Move char_buffer into a separate file
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:34 +02:00
Damian Jarek
a7ae580568
Remove unused includes from test::stream
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:34 +02:00
Damian Jarek
edca7dd18e
Remove redundant use of asio::coroutine in flat_stream
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:34 +02:00
Damian Jarek
a7ff1a41e7
Remove redundant instation of static_string in websocket
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:33 +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
2bc521d6ab
Add gcc-9 to AzP CI test matrix
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-04 15:31:18 +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
76842d637f
Reduce the number of instantiations of filter_token_list
Not using lambdas in this case reduced the number of instantiations of
the algorithm by a factor of 4x at no (observable) runtime cost.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-03 18:05:52 +02:00
Konstantin Podsvirov
56b5f8043f
Clean up typo in chat websocket javascript client
It so happened that the code works, because both variables exist,
but the code was not clean.

close #1620
2019-06-01 18:15:25 +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
Damian Jarek
d52b4e4bd3
Fix clang inititalization warning in websocket
Clang suggests using double braces when initializing a single subobject
of an aggregate.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-31 02:04:36 +02:00
Damian Jarek
ad66be6eb7
Fix separate compilation in CI
`optional` adds a "null" default feature value, effectively defaulting
to `off`, instead of `on`.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-31 02:04:35 +02:00
Vinnie Falco
e9781b225e
Fix flat_buffer copy members
fix #1621
2019-05-29 21:14:14 +02:00
Damian Jarek
8198571555
Use if statement in basic_stream:
An `if` statement is cheaper to instantiate without additional runtime
cost when optimizations are enabled.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-27 22:15:49 +02:00
Damian Jarek
894ab45052
Remove experimental/unit_test/thread.hpp
The file has been unused in Beast for a few releases.

Actions required:
- Copy the `thread` class into your project.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-27 22:13:13 +02:00
Damian Jarek
d0b0ab8961
Remove redundant dependencies in http/server/fast example
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-27 20:18:21 +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
Vinnie Falco
be460675bc
Preserve operation_aborted on partial message 2019-05-20 15:34:22 +02:00
Filip Matzner
1501962b92
Use steady_timer type
close #1606
2019-05-20 15:34:21 +02:00
Vinnie Falco
363d5c36d3
Don't pessimize-move 2019-05-20 15:34:21 +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
Damian Jarek
3fa468f840
Add 1-element specialization for buffers_cat
`buffers_cat` now supports 1 or more buffers sequences.

Close #1280

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-20 15:33:43 +02:00
Damian Jarek
9909fada29
allocator_traits::construct is used for user-defined types:
It should only be called when constructing a user-provided type.

Close #1332

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-20 15:29:21 +02:00
Konstantin Podsvirov
e5bad9cbc2
Make chat websocket javascript client more user friendly
Close #1611
2019-05-19 22:32:44 +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
e98fc22bec
Remove redundant template in service_base
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-19 22:32:43 +02:00
Damian Jarek
dcf3db7f83
Remove redundant use of static_string
This avoids an instantiation and copy of the data when adding the Server
header field.

Close #1613

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-19 22:32:43 +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
Damian Jarek
c254b4fcfb
Remove uses of the deprecated buffers function
Fix: 1607
Close: 1608

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-19 22:32:37 +02:00
Vinnie Falco
77f3bb0764 Fix moved-from executor in idle ping timeout
fix #1599
2019-05-04 18:47:44 -07:00
Vinnie Falco
6be11913a0 Add idle ping suspend test
close #1599
2019-05-04 18:47:37 -07:00
Damian Jarek
dbadb79a75
Silence gcc-8 warning:
The warning was caused by a false positive triggered by boost::optional.
Reference:
https://github.com/boostorg/optional/issues/72

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-04 17:30:25 +02:00
Damian Jarek
7a388b7da6
Fix uninitalized memory use in deflate_stream
Reference in original zlib:
https://github.com/madler/zlib/pull/393

Resolves: #1586

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-04 17:30:23 +02: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
Damian Jarek
fd52df9206
Fix data race in test stream
Resolve: #1594

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-05-02 19:39:22 +02:00
Damian Jarek
45aaf22acd Relax requirements for vector_body:
fix: #1567

std::byte is not an arithmetic type, which caused compilation to fail
when it was used in vector_body.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-04-20 10:19:31 -07:00
Vinnie Falco
e53ccf251c Fix min/max on MSVC
fix #1578
2019-04-19 11:36:00 -07:00
Vinnie Falco
0a334d96d1 member get_executor const-correctness
fix #1559
2019-04-19 11:18:55 -07:00
Vinnie Falco
db118f4dc4 Fix async_detect_ssl handler type
close #1569
2019-04-18 18:22:24 -07:00
Damian Jarek
fb7ed617cd Ensure beast is copied to libs/beast
The BUILD_DIR on Appveyor has different names sometimes, use a consistent
directory name to avoid build failures.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-04-18 16:42:27 -07:00
Vinnie Falco
71de05d3cc More std::string_view fixes 2019-04-18 16:15:42 -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
Eelis van der Weegen
9b10f08692 detect_ssl uses bool
close #1568
2019-04-15 08:21:46 -07:00
Vinnie Falco
a0932ea45c Update CHANGELOG.md 2019-04-11 14:01:51 -07:00
Vinnie Falco
1de60a0462 Move friend function template definition 2019-04-08 15:13:12 -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
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
90d7434847 decorator ctor is explicit 2019-04-03 11:16:38 -07:00
Vinnie Falco
7c084509d6 decorator constructor is constrained 2019-04-02 16:49:05 -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
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
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
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
18bf9b4037 Tidy up a doc code snippet 2019-03-28 09:53:27 -07:00
Vinnie Falco
ed9d861545 Fix ssl_stream teardown 2019-03-27 09:13:32 -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
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
tal
894917cb23
root_certificates.hpp: brought in the server certificate
close #1537

This allows for the self-sign ssl to work
2019-03-21 19:59:15 -07:00
Vinnie Falco
f5d08d7b2c Set version to 235 2019-03-21 17:23:49 +01:00
Vinnie Falco
1f560692ac Fix self-assignment warning in buffer test 2019-03-21 17:23:49 +01:00
Wes Turner
f016499206 DOC: README.md: https URLS
close #1525
2019-03-19 06:59:55 -07:00
Damian Jarek
05f3f8a5ce Remove the need for OpenSSL in examples that don't use it
close #1524

It is now possible to compile examples without OpenSSL. Examples that
do require OpenSSL will be omitted.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-19 06:59:55 -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
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
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
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
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
b51c4bb49a Tidy up examples 2019-03-06 05:40:49 -08:00
Vinnie Falco
9f2b0ce1db Rename to buffer_bytes 2019-03-05 11:09:53 -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
7f5a405e61 Tidy up quick reference 2019-03-04 14:45:10 -08:00
Vinnie Falco
1d8871c2f9 Fix includes.xsl for newer doxygen 2019-03-04 14:45:00 -08:00
Vinnie Falco
31c5d1f092 The Fields concept is deprecated (API Change):
* The Fields concept will be removed in a future version.
2019-03-04 14:44:48 -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
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