105 Commits

Author SHA1 Message Date
sehe
740879a995 Add http::message_generator 2022-05-21 22:12:13 -07:00
Vinnie Falco
6c9e9ea243 Tests are fat binaries 2022-05-21 22:12:13 -07:00
Glen Fernandes
24275ac0c6 Use static_string from Boost.StaticString 2022-04-17 12:30:52 -04:00
Martijn Otto
6ff7beae48 Add missing include for file_body test
close #2391
2022-03-09 16:35:24 +01:00
Richard Hodges
355dcfe502 Add individual tests to CMake workflow
close #2350
2021-12-09 14:27:18 +01:00
Michael Haubenschild
31a1fb332a Fix missing check for error code after header is parsed:
The missing error check leads to completely ignoring the body limit,
as the body limit is compared to the "Content-Length" header inside
the "finish_header" method.

closes #2201
2021-03-25 15:04:12 +01:00
Richard Hodges
fae4c0e3c2 Parenthesise all uses of min() and max() 2021-03-16 10:02:47 +01:00
Richard Hodges
bea31bfff6 Fix nullptr implicit cast on fields::set()
fixes #2085
2020-09-13 16:19:27 +02:00
Richard Hodges
91d9457ab9 Add Sec-* HTTP headers
fixes #2080
closes #2082
2020-09-07 17:26:34 +02:00
Richard Hodges
9e6822773e Fix erroneous error when HTTP body_limit is none
fixes #2070
closes #2073
2020-08-28 13:26:59 +02: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
Richard Hodges
0fdf9cb4df Parser body_limit is optional (API Change):
API Changes:

The signature of basic_parser<>::body_limit(n) has changed. It now accepts an
optional std::uint64_t. The caller may indicate that no body limit is required
by calling body_limit(boost::none). The default limits remain in place in order
to maintain 'safe by default' behaviour.

closes #1897
closes #1965
2020-05-29 20:28:22 +02:00
Richard Hodges
1054661723 Fix http read bytes_transferred (API Change)
fixes #1942
2020-05-20 15:54:52 +02:00
Richard Hodges
fda558e034 Fix standalone compilation error with std::string_view
fixes #1913
2020-04-30 21:00:00 +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
Richard Hodges
d12dcef52c Fix Content-Length parsing
Fix #1880
2020-03-19 16:21:29 +01:00
Richard Hodges
c682eb46e7 Fix warning in test 2020-02-29 10:43:52 -08:00
Richard Hodges
6d10adf936 fix erase field
fixes #1828
closes #1829
2020-02-04 18:36:50 +01:00
Richard Hodges
3d168c0336 file body reports short_read on eof
fixes #1818
fixes #1815
close #1821
2020-01-28 10:24:44 +01: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
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
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
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
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
71de05d3cc More std::string_view fixes 2019-04-18 16:15:42 -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
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
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
00487f1de6 Reusing an HTTP parser returns an error 2019-02-28 10:27:43 -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
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
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
44d9eaba4d Tidying 2019-02-05 09:56:48 -08:00
Vinnie Falco
35dbd140d4 Add buffer_size 2019-02-03 12:59:11 -08:00
Vinnie Falco
a142969c5d Qualify buffer_copy, don't qualify buffer_size:
fix #1416

* Calls to buffer_copy are qualified as net::buffer_copy
* Calls to buffer_size are made unqualified, permitting
  argument dependent lookup to take effect.
2019-02-02 13:01:27 -08:00
Vinnie Falco
944b5dcda7 Clear error codes idiomatically 2019-01-20 09:50:43 -08:00
Vinnie Falco
cbd5e76e92 Add type_traits tests 2018-12-19 21:51:49 -08:00
Vinnie Falco
cf06a8dd6a Adjust CI scripts for superproject changes 2018-12-19 20:59:19 -08:00
Vinnie Falco
35e4f321bc Refactor HTTP operations (API Change):
* Revise stream algorithm javadocs

* HTTP stream algorithms now use beast::read and
  beast::async_read with a custom completion condition.

API Changes:

* HTTP stream algorithms return the number of bytes transferred
  from the stream. Previously, they returned the number of bytes
  consumed by the parser.

Actions Required:

* Callers depending on the return value of http::read or
  http::async_read overloads should adjust the usage of
  the returned value as needed.
2018-12-06 15:50:26 -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
5bff4ed8ab Tidy up warnings and deprecated usage:
fix #1290

* BOOST_ASIO_NO_DEPRECATED=1 is now set
* Fix various warnings from the Boost regression test matrix
* Fix a bug in advanced servers when checking for a timeout
2018-11-26 15:30:48 -08:00
Vinnie Falco
c18f3f0ef1 Rename to _experimental directory 2018-11-12 06:52:39 -08:00