Commit Graph
488 Commits
Author SHA1 Message Date
Vinnie Falco fe4dfed27b Tidy up type_traits 2017-07-20 08:12:19 -07:00
Vinnie Falco ff8be0e931 Avoid a parser allocation using non-flat buffer:
When the parser is presented with an input buffer
sequence with length greater than one, the input is
flattened using stack space instead of dynamic
allocation if the buffer size is no greater than 8192.
2017-07-20 08:12:19 -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 87c6e69d9f Don't allocate memory to handle obs-fold 2017-07-20 08:12:19 -07:00
Vinnie Falco add95d6ef6 Set version to 54 2017-07-20 08:12:19 -07:00
Vinnie Falco d529d6a16f Documentation work 2017-07-20 08:12:19 -07:00
Vinnie Falco 857fc22667 Fix incorrect use of [[fallthrough]]
fix #468
2017-07-20 08:12:19 -07:00
Vinnie Falco f44380159a Retain ownership when reading using a message
fix #469
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 4a3b42b398 Set version to 53 2017-07-20 08:12:19 -07:00
Vinnie Falco 8f88f9c3bb Remove extraneous doc file 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 e4fdeecc3b Fix basic_parser::maybe_flatten (#462) 2017-07-20 08:12:19 -07:00
Vinnie Falco 140246957e Set version to 52 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 6c9bdd2c32 Documentation work 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 eaa820df30 Set version to 51 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 4bbb21d7af Use BOOST_STRINGIZE
fix #384
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
Niklas Schnelle 38c36ac655 Fix file_body::get() not setting the more flag correctly
The check for more data actually checked if the end of data was reached
so it was logically inverted.

This fixes #434
2017-07-20 08:12:19 -07:00
Vinnie Falco 9af1b35252 Tidy up file_body
fix #439
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 0a5fec1e9d Fix operator<< for header 2017-07-20 08:12:19 -07:00
Vinnie Falco 98157f392e Set version to 50 2017-07-20 08:12:19 -07:00
Vinnie Falco 38ac1b8364 http read_some, async_read_some don't return bytes (API Change):
fix #431, fix #430

The read_some and async_read_some HTTP operations no longer
return the number of bytes that the caller should consume.
Instead, the bytes are automatically removed from the dynamic
buffer as indicated by the parser.
2017-07-20 08:12:19 -07:00