Commit Graph
209 Commits
Author SHA1 Message Date
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
Vinnie Falco 3d6574da81 ping_callback is a member of stream (API Change):
fix #446

* The ping_callback option struct is removed.

Actions Required:

* Change call sites which use ping_callback with set_option to
  call stream::ping_callback instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco 333067243f write_buffer_size is a member of stream (API Change):
fix #446

* The write_buffer_size option struct is removed.

Actions Required:

* Change call sites which use write_buffer_size with set_option to
  call stream::write_buffer_size instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco b9dbb76c4f read_message_max is a member of stream (API Change):
fix #446

* The read_message_max option struct is removed.

Actions Required:

* Change call sites which use read_message_max with set_option to
  call stream::read_message_max instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco 513a54835c read_buffer_size is a member of stream (API Change):
fix #446

* The read_buffer_size option struct is removed

Actions Required:

* Change call sites which use read_buffer_size with set_option to
  call stream::read_buffer_size instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco e6c0d698ee binary, text are members of stream (API Change):
fix #446

* message_type is removed

Actions Required:

* Change call sites which use message_type with set_option
  to call stream::binary or stream::text instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco f22895224b auto_fragment is a member of stream (API Change):
fix #374, fix #446

* auto_fragment option struct is removed

Actions Required:

* Change call sites which use auto_fragment with set_option
  to call stream::auto_fragment instead.
2017-07-20 08:12:19 -07:00
Vinnie Falco 669b1feae1 Documentation work 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 7b56f352b4 Add construct, destroy to handler_alloc
fix #432
2017-07-20 08:12:19 -07:00
Vinnie Falco 196d9c60fa multi_buffer implementation change (API Change):
fix #440

WARNING

multi_buffer constructor now takes a maximum size instead of the
"allocation size". This is a breaking change. The allocation size
feature is removed. To update calling code, remove the allocation
size parameter from call sites.

* multi_buffer now uses a geometric growth algorithm for better performance.
2017-07-20 08:12:19 -07:00
Vinnie Falco 74c26a8869 DynamicBuffer benchmarks
fix #441
2017-07-20 08:12:19 -07:00
Vinnie Falco 55358835c6 Use BOOST_FALLTHROUGH
fix #437
2017-07-20 08:12:19 -07:00
Vinnie Falco cff5be3837 Documentation work 2017-07-20 08:12:19 -07:00
Vinnie Falco 7952578e1d Tune up static_buffer (API Change):
The static buffer is updated:

* reset() is no longer a member. Use b.consume(b.size()) instead.

* Simplified implementaton, uses asio instead of custom types

* Better stream performance: consuming the input makes room
  available in the output. This class is now suitable for
  HTTP reads.

These changes permit the static_buffer wrapper to adapt a user
memory buffer if desired, including a stack based array.
The static_buffer_n class may also be used for this purpose,
it comes with its own storage.
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 8a22350119 Tidy up traits
fix #406
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