2
0
mirror of https://github.com/boostorg/beast.git synced 2026-01-19 16:12:10 +00:00

68 Commits

Author SHA1 Message Date
Mohammad Nejati
e0884660f4 Add examples of Unix domain sockets
Closes #2918
2025-02-28 16:38:36 +03:30
Mohammad Nejati
827ecf5e93 Organize source files in CMakeLists with source_group 2024-11-25 11:41:40 +03:30
Mohammad Nejati
75e45287fb Refactor CMakeLists
Closes #2471
Closes #1816
2024-11-25 11:41:40 +03:30
Mohammad Nejati
3ddcf4ed38 Jamfile cleanup 2024-09-04 22:37:14 +03:30
Mohammad Nejati
ff5672ec07 awaitable examples are simplified
No need for `rebind_executor` as `asio::deferred` is now the default completion token.
2024-07-07 14:58:49 +03:30
Mohammad Nejati
03b792faac net::ssl::stream is canonical in examples
We no longer need to use beast::ssl_stream to improve write performance, as
Asio now linearizes scatter/gather I/O in ssl::stream:
17637a48cc
2024-05-31 16:45:52 +03:30
Mohammad Nejati
bd804b6520 ssl_stream does not use flat_stream
We no longer need to use flat_stream to improve write performance, as
Asio now linearizes scatter/gather I/O in ssl::stream:
17637a48cc
2024-05-31 16:45:52 +03:30
Mohammad Nejati
6dd3cf7ab1 std::bind is superfluous in some examples 2024-05-31 16:45:52 +03:30
Klemens Morgenstern
2bd65b27e1 awaitable server close fix.
Closes #2637
2023-02-20 13:58:07 +08:00
Klemens
99bceb5bff examples & tests use context instead of coroutine. 2023-02-02 23:27:49 +08:00
Klemens Morgenstern
09bfca1fa1 awaitable examples.
Closes #2104.
2022-10-30 00:13:54 +08:00
sehe
87ddb16151 Examples use http::message_generator 2022-05-21 22:12:13 -07:00
Daniel Engelke
9201210d5e fields_alloc does not leak
fix #2431, close #2432
2022-05-21 18:15:33 -07:00
Hreniuc Cristian-Alexandru
2f4506dc37 Fix accept error handling in http_server_async example
close #2319
2021-11-03 18:39:42 +01:00
Richard Hodges
70bddce07f Fix warning in http-server-fast 2021-03-16 10:03:25 +01:00
Richard Hodges
fae4c0e3c2 Parenthesise all uses of min() and max() 2021-03-16 10:02:47 +01:00
Richard Hodges
14c3d50b57 Deprecate string_param (API Change):
API Changes:

`string_param`, which was previously the argument type when setting field values
has been replaced by `string_view`. Because of this, it is no longer possible to
set message field values directly as integrals.

Users are required to convert numeric arguments to a string type prior to calling
`fields::set` et. al.

Beast provides the non-allocating `to_static_string()` function for this purpose.

To set Content-Length field manually, call `message::content_length`.

fixes #1956
2020-06-12 17:33:20 +02:00
Damian Jarek
3817fb4c94 Fix data race in http server examples
When using `beast::tcp_stream`, the user must make sure that async operations
are initiated from within the strand associated with the stream.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-10-06 07:52:13 -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
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
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
Filip Matzner
1501962b92 Use steady_timer type
close #1606
2019-05-20 15:34:21 +02:00
Eelis van der Weegen
9b10f08692 detect_ssl uses bool
close #1568
2019-04-15 08:21:46 -07:00
Vinnie Falco
4e90183bda Check defined(BOOST_MSVC) 2019-03-29 20:42:44 -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
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
Vinnie Falco
b51c4bb49a Tidy up examples 2019-03-06 05:40:49 -08:00
Vinnie Falco
fca4b3ae10 make_strand is in net:: 2019-03-02 07:33:57 -08:00
Vinnie Falco
6331e03a3a OpenSSL is required for tests and examples 2019-02-23 11:15:59 -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
90b783cb62 detect_ssl, async_detect_ssl are public interfaces 2019-02-22 15:39:34 -08:00
Vinnie Falco
6ada618c12 Check BOOST_NO_CXX11_THREAD_LOCAL 2019-02-21 11:09:02 -08:00
Vinnie Falco
c3c3777661 Pass strand to async_accept 2019-02-20 15:30:03 -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
00e8c381cd Examples use ssl_stream
fix #1455
2019-02-16 15:09:35 -08:00
Vinnie Falco
18447553ca Examples use bind_front_handler 2019-02-14 17:28:54 -08:00
Vinnie Falco
5b97fbb966 Use timeouts in HTTP server examples 2019-02-10 11:42:01 -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
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
b3a8e6edb5 Tidy up calls to placement new 2018-12-02 19:48:42 -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
82e87ea188 Workaround for http-server-fast and libstdc++:
This fixes a problem where libstdc++ incorrectly assumes that the
allocator used with basic_string is DefaultConstructible.

See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56437
2018-09-23 19:08:30 -07:00
felixguendling
ba4bdfed71 Fix http_server_stackless_ssl.cpp example
fix #1210

Write to self_.stream_ instead of the socket_ directly
2018-07-28 07:00:51 -07:00
Vinnie Falco
92d34b9e3b Use static_cast instead
fix #1163
2018-07-15 09:11:15 -07:00
cos-public
c2ecba968c Check error in example set_option
fix #1186
2018-07-12 11:07:10 -07:00
Vinnie Falco
f48b978044 Use a shared string for example HTTP server doc roots
fix #1109
2018-05-03 14:18:33 -07:00
Vinnie Falco
c592782a1b Simplify some type trait expressions
fix #466
2018-04-26 17:30:46 -07:00