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.
This commit is contained in:
Vinnie Falco committed 2017-07-20 08:12:20 -07:00
1 parent fe4dfed27b
commit a49c096042
18 files changed
+212 -147

No files matched your search

@@ -10,8 +10,8 @@
#include <beast/core/error.hpp>
#include <beast/core/consuming_buffers.hpp>
#include <beast/core/read_size.hpp>
#include <beast/core/detail/ci_char_traits.hpp>
#include <beast/core/detail/read_size_helper.hpp>
#include <beast/zlib/deflate_stream.hpp>
#include <beast/zlib/inflate_stream.hpp>
#include <beast/websocket/option.hpp>
@@ -370,7 +370,7 @@ inflate(
{
// VFALCO we could be smarter about the size
auto const bs = buffer.prepare(
maybe_read_size_helper(buffer, 65536));
read_size_or_throw(buffer, 65536));
auto const out = *bs.begin();
zs.avail_out = buffer_size(out);
zs.next_out = buffer_cast<void*>(out);