Commit Graph
133 Commits
Author SHA1 Message Date
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 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 49a2b33b82 basic_fields members and coverage 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 04522398e0 Fix infinite loop in basic_parser
fix #452
2017-07-20 08:12:19 -07:00
Vinnie Falco cff5be3837 Documentation work 2017-07-20 08:12:19 -07:00
Vinnie Falco 6203074c92 Fix chunk header parsing
fix #431, fix #430
2017-07-20 08:12:18 -07:00
Vinnie Falco 7d89fdc46f Remove obsolete serializer allocator (API Change) 2017-07-20 08:12:18 -07:00
Vinnie Falco aa752e4dce Remove message free functions (API Change) 2017-07-20 08:12:18 -07:00
Vinnie Falco 3340666ad3 Remove message connection settings (API Change) 2017-07-20 08:12:18 -07:00
Vinnie Falco 943830f6ed Fields concept work 2017-07-20 08:12:18 -07:00
Vinnie Falco fb2f777b4d Use field in basic_parser 2017-07-20 08:12:18 -07:00
Vinnie Falco ca25eee0dd Use field in basic_fields and call sites 2017-07-20 08:12:18 -07:00
Vinnie Falco ace99bd6c0 Protect basic_fields special members (API Change) 2017-07-20 08:12:18 -07:00
Vinnie Falco 67df48daa6 Documentation work 2017-07-20 08:12:18 -07:00
Vinnie Falco 2df6783468 Refactor prepare (API Change) 2017-07-20 08:12:18 -07:00
Vinnie Falco 2af19481a9 Derive header from Fields (API Change) 2017-07-20 08:12:18 -07:00
Vinnie Falco 5f2e7560b6 Use allocator more in basic_fields
Fix #392
2017-07-20 08:12:18 -07:00
Vinnie Falco ff216a89a8 Add verb to on_request for parsers (API Change) 2017-07-20 08:12:18 -07:00
Vinnie Falco 1c063f5bf6 Add field enumeration 2017-07-20 08:12:18 -07:00
Vinnie Falco 9f7abcbe2d Remove header_parser (API Change) 2017-07-20 08:12:18 -07:00
Vinnie Falco fa28cba515 parser is constructible from other body types 2017-07-20 08:12:18 -07:00
Vinnie Falco 4b866cea36 Documentation work 2017-07-20 08:12:18 -07:00
Vinnie Falco b38f8260b8 Add HEAD request example 2017-07-20 08:12:18 -07:00
Vinnie Falco 3803c38dbd Refactor header status, reason, and target (API Change):
* header::result is a family of functions to replace header::status

* header interface now uses status enum and also ints

* reason-phrase is no longer stored unless the user explicitly
  requests it.

* When serializing, the standard reason is used for the
  corresponding status code unless the user has changed it.
2017-07-20 08:12:18 -07:00
Vinnie Falco 4f91e632bc Tidy up empty_body writer error 2017-07-20 08:12:18 -07:00
Vinnie Falco aa2c915c96 Canonicalize string_view parameter types 2017-07-20 08:12:18 -07:00
Vinnie Falco 048ee7523c Refactor method and verb (API Change):
The verb interfaces now use verb::unknown instead of
boost::optional<verb> == boost::none to indicate that
the request-method is an unrecognized string.

The http::header interface is modified to focus more on the
verb enum rather than the string. For recognized verbs, the
implementation stores an integer instead of the string.
Unknown verbs are still stored as strings.

* header::method now returns a verb
* header::method_string returns the method text
2017-07-20 08:12:18 -07:00
Vinnie Falco 4b158e45ba Remove detail::sync_ostream
fix #418
2017-07-20 08:12:18 -07:00
Vinnie Falco 78d9e3bbce Documentation work 2017-07-20 08:12:18 -07:00
Vinnie Falco 00667f3cf2 Rename to parser (API Change):
* message_parser is renamed to parser
2017-07-20 08:12:18 -07:00
Vinnie Falco 88600beab0 Consolidate parsers to parser.hpp
fix #405
2017-07-20 08:12:18 -07:00
Vinnie Falco 86ce017ffe Documentation work 2017-07-20 08:12:18 -07:00
Vinnie Falco 2141fabcf9 Tidy up chunk decorator (API Change):
* Rename to no_chunk_decorator
* Decorator no longer has to append "\r\n" to the returned string
2017-07-20 08:12:18 -07:00
Vinnie Falco 02d5aedc29 Refactor HTTP serialization and parsing (API Change):
fix #404

Parsing and serialization interfaces have been fine tuned and unified.

For parsing these stream operations are defined:

* read
* read_header
* read_some
* async_read
* async_read_header
* async_read_some

For serialization these stream operations are defined:

* write
* write_header
* write_some
* async_write
* async_write_header
* async_write_some
2017-07-20 08:12:17 -07:00
Vinnie Falco e5cfe9c11f Refactor treatment of status code and obsolete reason (API Change):
fix #398

A new enum status is added for the status code.

The function obsolete_reason returns default reason phrasing.

If a response has an empty reason, the serializer will
automatically insert the default reason phrase for the
status code.
2017-07-20 08:12:17 -07:00
Vinnie Falco f7211da154 Refactor treatment of request-method (API Change):
fix #397

method enum class is added to represent all known request methods.
Functions are provided to convert from strings to and from the method
enumeration.

The fields container is modified to also work with the enum.
2017-07-20 08:12:17 -07:00
Vinnie Falco 060f4a007b Refactor serialization algorithms:
serializer interface is changed to be buffer-only, no streams,
and placed in its own header file.

Operations on serializers are moved to free functions as part
of the HTTP write family of synchronous and asynchronous algorithms.
2017-07-20 08:12:17 -07:00
Vinnie Falco d0d08e81f9 Rename to make_serializer 2017-07-20 08:12:17 -07:00
Vinnie Falco 75b0571e83 Refactor type_traits (API Change):
fix #373

* concepts.hpp is renamed to type_traits.hpp

* Body reader and writer concepts are renamed
2017-07-20 08:12:17 -07:00