799 Commits
Author SHA1 Message Date
Vinnie Falco 56a561da9a message::prepare_payload replaces message::prepare (API Change):
Actions Required:

* Change calls to msg.prepare to msg.prepare_payload. For messages
  with a user-defined Fields, provide the function prepare_payload_impl
  in the fields type according to the Fields requirements.
2017-07-20 08:15:27 -07:00
Vinnie Falco f9f6e1e0cc Refine FieldsReader concept (API Change)
* FieldsReader now requires chunked() and keep_alive()

* serializer logic calls into the reader to calculate
  the message metadata

* Removed some of the previous requirements of FieldsReader

Actions Required:

* Implement chunked() and keep_alive() for user defined FieldsReader types.
2017-07-20 08:15:27 -07:00
Vinnie Falco 50902c3938 parser requires basic_fields (API Change):
* `parser` is now templated on Allocator

* `parser` only produces messages using `basic_fields<Allocator>`
  as the Fields type.

* message-oriented read and async_read only work on messages
  using basic_fields as the Fields type.

Actions Required:

* Callers using `parser` with Fields types other than basic_fields
  will need to create their own subclass of basic_parser to work
  with their custom fields type.
2017-07-20 08:15:27 -07:00
Vinnie Falco 4d393f4c2a Clear the error faster 2017-07-20 08:15:27 -07:00
Vinnie Falco d5f15976e7 Tidy up test build scripts and projects 2017-07-20 08:15:27 -07:00
Vinnie Falco 79eb97fbd6 Add server-framework tests 2017-07-20 08:15:27 -07:00
Vinnie Falco e4ed62df0b Increase detail::static_ostream coverage 2017-07-20 08:15:27 -07:00
Vinnie Falco abed397bc0 Don't run slow tests on certain targets 2017-07-20 08:15:27 -07:00
Vinnie Falco 0a4f964811 Tidy up resolver calls 2017-07-20 08:15:27 -07:00
Vinnie Falco a4a4121444 Add multi_port to server-framework 2017-07-20 08:15:27 -07:00
Vinnie Falco 8f627b0748 Fix shadowing warnings
fix #510
2017-07-20 08:15:27 -07:00
Vinnie Falco 65932ee343 Add server-framework SSL HTTP and WebSocket ports 2017-07-20 08:15:27 -07:00
Vinnie Falco c8b8439ebc Tidy up names in error categories 2017-07-20 08:15:27 -07:00
Vinnie Falco 30e6426db5 Tidy up some integer conversion warnings 2017-07-20 08:15:27 -07:00
Vinnie Falco fd9a13b11f New server-framework, full featured server example:
A new server framework is introduced, allowing users to
quickly get off the ground. Example servers are refactored
to use the common framework.
2017-07-20 08:15:26 -07:00
Vinnie Falco b5306a5712 String comparisons are public interfaces 2017-07-20 08:15:26 -07:00
Vinnie Falco 321aa8527d Fix base64 alphabet
fix #500
2017-07-20 08:15:26 -07:00
Sacha 0a2a03acfa Integrated Beast interface. 2017-07-20 08:15:26 -07:00
Vinnie Falco dba4be01ab Fix parsing chunk size with leading zeroes
fix #496
2017-07-20 08:15:26 -07:00
Vinnie Falco f64109d79a Fix basic_fields insert ordering 2017-07-20 08:15:26 -07:00
Vinnie Falco eb7e971c7a Renamed to basic_fields::set (API Change):
* `replace` is renamed to `set`

Actions Required:

* Rename calls to `basic_fields::replace` to `basic_fields::set`
2017-07-20 08:15:26 -07:00
Vinnie Falco 510092d34b Reorganize examples:
* The examples/ directory is renamed to example/

* Each program is in its own directory with its own build scripts
2017-07-20 08:15:26 -07:00
Vinnie Falco 2eeedb8a41 Fix warning in basic_parser.cpp 2017-07-20 08:12:20 -07:00
Vinnie Falco 82d76e4882 Convert buffer in range loops
fix #485
2017-07-20 08:12:20 -07:00
Vinnie Falco 9939320c83 More basic_parser tests 2017-07-20 08:12:20 -07:00
Vinnie Falco ca109693fb Reset error codes
fix #478
2017-07-20 08:12:20 -07:00
Vinnie Falco 7d92048c5c Test error code handling
fix #478
2017-07-20 08:12:20 -07:00
Vinnie Falco 7712ca09b2 Add string_view_body 2017-07-20 08:12:20 -07:00
Vinnie Falco 0f54bc72a4 Add provisional IANA header field names
fix #473
2017-07-20 08:12:20 -07:00
Vinnie Falco 4d21f8d2cf Revert "Add a Beast CMake interface target:"
This reverts commit 906db45bec.
2017-07-20 08:12:20 -07:00
Vinnie Falco 7bde07a850 Documentation work 2017-07-20 08:12:20 -07:00
Vinnie Falco a49c096042 read_size replaces read_size_helper:
* detail::read_size_helper is removed

* public function read_size helps determine the optimum
  size for calls to a DynamicBuffer's prepare function.

* special case for Asio types which don't conform to
  the concept but have their own helper function.
2017-07-20 08:12:20 -07:00
Sacha 3c453209fe Add a Beast CMake interface target:
fix #461

This target allows other CMake projects to acquire
the Beast headers and link libraries easily.
2017-07-20 08:12:19 -07:00
Vinnie Falco d529d6a16f Documentation work 2017-07-20 08:12:19 -07:00
Vinnie Falco 8c4136bb73 basic_fields refactor (API Change):
* Container interface more closely matches std::vector

* While preserving the invariant that duplicate fields
  with the same case-insensitive name have their order
  preserved.
2017-07-20 08:12:19 -07:00
Vinnie Falco 0d70d90b75 Add string_param
fix #451
2017-07-20 08:12:19 -07:00
Vinnie Falco 49a2b33b82 basic_fields members and coverage 2017-07-20 08:12:19 -07:00
Vinnie Falco e58833d7dd consuming_buffers members and coverage 2017-07-20 08:12:19 -07:00
Vinnie Falco 260b506520 multi_buffer members and coverage
fix #458
2017-07-20 08:12:19 -07:00
Vinnie Falco 5d6d486da4 flat_buffer coverage 2017-07-20 08:12:19 -07:00
Vinnie Falco 99f2425de4 static_buffer coverage 2017-07-20 08:12:19 -07:00
Vinnie Falco 78f4858e98 Fix read_size_helper usage:
read_size_helper can return zero if the buffer reaches
its maximum size, causing infinite loops in HTTP. The
function maybe_read_size_helper is provided to throw
an exception instead of returning a value for this case.
2017-07-20 08:12:19 -07:00
Vinnie Falco 5149cf8495 Add drain_buffer class
fix #457
2017-07-20 08:12:19 -07:00
Vinnie Falco 23863230de flat_buffer is an AllocatorAwareContainer
fix #453
2017-07-20 08:12:19 -07:00
Vinnie Falco 44995bf071 Documentation work 2017-07-20 08:12:19 -07:00
Vinnie Falco b49b23ee83 finish(error_code&) is a BodyReader requirement (API Change) 2017-07-20 08:12:19 -07:00
Vinnie Falco 64742a4183 opcode is private (API Change):
* The opcode enum is removed.

Actions Required:

* Remove all occurences of the `opcode` enum at call sites
2017-07-20 08:12:19 -07:00
Vinnie Falco ce70d45c7a Disable std::future snippet for libstdc++ bug 2017-07-20 08:12:19 -07:00
Vinnie Falco 9e910761cc read_frame returns bool fin (API Change):
* frame_info struct is removed

* read_frame and async_read_frame return a bool indicating
  if the frame is the last frame of the current message.

Actions Required:

* Remove the frame_info parameter from all read frame call sites

* Check the return value 'fin' for calls to read_frame

* Change ReadHandlers passed to async_read_frame to have
  the signature void(error_code, bool fin), use the bool
  to indicate if the frame is the last frame.
2017-07-20 08:12:19 -07:00
Vinnie Falco 620ce08d6a Remove opcode from read, async_read (API Change):
fix #446

* Read signatures no longer include `opcode`

* stream::got_binary and stream::got_text inform the caller if
  the current incoming message is binary or text.

Actions Required:

* Remove the `opcode` reference parameter from calls to synchronous
  and asynchronous read functions, replace the logic with calls to
  stream::got_binary and stream::got_text instead.
2017-07-20 08:12:19 -07:00