218 Commits
Author SHA1 Message Date
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
Mohamed El Housseine ebe52537ea Set parser status and flags even if body_limit_ has been reached
close #1556
2019-04-08 17:14:46 -07:00
Denis Glazachev 058294e908 Fix http::message constructor constraint 2019-03-30 14:14:59 -07:00
Denis Glazachev 24ccdd243a Fix some typos 2019-03-30 11:12:04 -07:00
Vinnie Falco a7faf03694 Fix http::message constructor constraint 2019-03-29 20:42:44 -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
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 b7c3c1eb1a Fix file_win32_write_op async initiation 2019-03-12 18:07:19 -07:00
Damian Jarek dc52df351a Enable more split compilation in websocket and http
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-10 13:23:22 -07: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 e073a9e7fc Tidy up docs 2019-03-05 20:15:07 -08: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 8e2620e2b1 Doc tidy 2019-03-05 08:00:14 -08:00
Vinnie Falco 0e4e7ff370 ~basic_parser is virtual 2019-03-03 19:31:52 -08:00
Vinnie Falco 1432d336be Move parser definitions to .ipp 2019-03-02 09:13:08 -08:00
Vinnie Falco edf5b7cd03 Fix HTTP parser static string calculation 2019-03-02 09:13:08 -08:00
Damian Jarek c7a7d16992 Allow the use of string_body and vector_body with -fno-exceptions
`string_body` and `vector_body` will no longer translate all exceptions
to "buffer_overflow" error code. `buffer_overflow` error can now only
occur if the Body's max_size() is exceeded.

Changes required:
Code that relies on exceptions thrown from value_type's reserve/resize
being translated into an error code must implement a mechanism to catch
the exception.

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-03-01 14:50:50 -08:00
Vinnie Falco 8c53abe6e5 Support -fno-exceptions 2019-03-01 13:52:50 -08:00
Vinnie Falco 00487f1de6 Reusing an HTTP parser returns an error 2019-02-28 10:27:43 -08:00
Vinnie Falco 7953ac281f Pass references as pointers to async_initiate 2019-02-26 07:21:05 -08:00
Vinnie Falco 81f33a0f89 Rename to async_base, stable_async_base 2019-02-26 07:20:08 -08:00
Vinnie Falco f92999b613 Doc work 2019-02-23 12:04:48 -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 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 46eb006757 Tidy up docs 2019-02-22 19:46:29 -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 d08cc82e15 Use async_initiate 2019-02-21 06:39:35 -08:00
Vinnie Falco eea3929b26 Concept check tidying 2019-02-20 19:19:59 -08:00
Vinnie Falco 2b92189b65 Doc tidying 2019-02-20 19:09:21 -08:00
Vinnie Falco b7f2792062 Fix file_body_win32
fix #1464
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 79c777e776 Tidying and fixes 2019-02-18 12:18:27 -08:00
Vinnie Falco f41363c60c Add async_op_base::invoke 2019-02-16 15:09:33 -08:00
Vinnie Falco fdaf2ea7e1 Rename to async_op_base::invoke_now 2019-02-16 13:36:01 -08:00
Vinnie Falco 168f674b4a Improved websocket stream documentation
fix #1213
2019-02-10 05:51:42 -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 adcd4bc0c9 is_completion_handler, type_traits.hpp are deprecated (API Change):
* is_completion_handler is deprecated
* type_traits.hpp is a deprecated include

These items will be removed in the next version

* Include the new header file for the types needed:
  - stream_traits.hpp
  - file_base.hpp
* Use std::is_invocable instead of is_completion_handler
2019-02-05 14:16:30 -08:00
Vinnie Falco 8ea8f41bba is_file is in file_base.hpp (API Change):
* The metafunction `is_file` is part of file_base.hpp

Actions Required

* Include file_base.hpp as needed
2019-02-05 09:56:49 -08:00
Vinnie Falco 44d9eaba4d Tidying 2019-02-05 09:56:48 -08:00
Vinnie Falco 98aed8ed49 Fix hexadecimal string conversion table:
Defect discovered by PVS-Studio
2019-02-05 09:56:36 -08:00
Vinnie Falco 9cee4e053f Add executor_type trait 2019-02-05 07:46:09 -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
Peter Dimov e0db595760 Faster http::string_to_field:
* Optimize hash calculation and equality for field strings

Experiments show the digest and equality functions taking the
most time. Optimizing L1 cache usage did not show significant
improvements.
2019-02-02 10:04:43 -08:00
Vinnie Falco 944b5dcda7 Clear error codes idiomatically 2019-01-20 09:50:43 -08:00
Vinnie Falco ca5a70a3cd parse_until is not static
fix #1393
2019-01-15 11:42:05 -08:00
Vinnie Falco 3599ccb09a Add tests for async_op_base 2019-01-11 20:06:56 -08:00
Vinnie Falco 5292df6e72 async_op_base is a public interface:
This utility simplifies the authoring of composed
operations, see documentation for details.
2019-01-09 09:54:53 -08:00