Add buffer_size

This commit is contained in:
Vinnie Falco committed 2019-02-03 12:59:11 -08:00
1 parent 64149f434a
commit 35dbd140d4
64 files changed
+427 -379

No files matched your search

@@ -10,6 +10,7 @@
#ifndef BOOST_BEAST_WEBSOCKET_IMPL_ACCEPT_IPP
#define BOOST_BEAST_WEBSOCKET_IMPL_ACCEPT_IPP
#include <boost/beast/core/buffer_size.hpp>
#include <boost/beast/websocket/detail/type_traits.hpp>
#include <boost/beast/http/empty_body.hpp>
#include <boost/beast/http/parser.hpp>
@@ -122,7 +123,6 @@ public:
void run(Buffers const& buffers)
{
error_code ec;
using net::buffer_size;
auto const mb = beast::detail::dynamic_buffer_prepare(
ws_.impl_->rd_buf, buffer_size(buffers), ec,
error::buffer_overflow);
@@ -296,7 +296,6 @@ accept(
ConstBufferSequence>::value,
"ConstBufferSequence requirements not met");
impl_->reset();
using net::buffer_size;
auto const mb = beast::detail::dynamic_buffer_prepare(
impl_->rd_buf, buffer_size(buffers), ec,
error::buffer_overflow);
@@ -327,7 +326,6 @@ accept_ex(
ConstBufferSequence>::value,
"ConstBufferSequence requirements not met");
impl_->reset();
using net::buffer_size;
auto const mb = beast::detail::dynamic_buffer_prepare(
impl_->rd_buf, buffer_size(buffers), ec,
error::buffer_overflow);
+1 -4
View File
@@ -10,6 +10,7 @@
#ifndef BOOST_BEAST_WEBSOCKET_IMPL_READ_HPP
#define BOOST_BEAST_WEBSOCKET_IMPL_READ_HPP
#include <boost/beast/core/buffer_size.hpp>
#include <boost/beast/websocket/teardown.hpp>
#include <boost/beast/websocket/detail/mask.hpp>
#include <boost/beast/core/async_op_base.hpp>
@@ -82,8 +83,6 @@ public:
bool cont = true)
{
using beast::detail::clamp;
using net::buffer;
using net::buffer_size;
auto& impl = *ws_.impl_;
cont_ = cont;
BOOST_ASIO_CORO_REENTER(*this)
@@ -881,8 +880,6 @@ read_some(
MutableBufferSequence>::value,
"MutableBufferSequence requirements not met");
using beast::detail::clamp;
using net::buffer;
using net::buffer_size;
close_code code{};
std::size_t bytes_written = 0;
ec = {};
@@ -10,6 +10,7 @@
#ifndef BOOST_BEAST_WEBSOCKET_IMPL_STREAM_HPP
#define BOOST_BEAST_WEBSOCKET_IMPL_STREAM_HPP
#include <boost/beast/core/buffer_size.hpp>
#include <boost/beast/websocket/rfc6455.hpp>
#include <boost/beast/websocket/teardown.hpp>
#include <boost/beast/websocket/detail/hybi13.hpp>
@@ -282,7 +283,6 @@ parse_fh(
DynamicBuffer& b,
error_code& ec)
{
using net::buffer_size;
if(buffer_size(b.data()) < 2)
{
// need more bytes
@@ -57,7 +57,6 @@ public:
error_code ec = {},
std::size_t bytes_transferred = 0)
{
using net::buffer;
using tcp = net::ip::tcp;
BOOST_ASIO_CORO_REENTER(*this)
{
@@ -130,7 +129,6 @@ teardown(
net::ip::tcp::socket& socket,
error_code& ec)
{
using net::buffer;
if(role == role_type::server)
socket.shutdown(
net::ip::tcp::socket::shutdown_send, ec);
@@ -140,7 +138,7 @@ teardown(
{
char buf[2048];
auto const bytes_transferred =
socket.read_some(buffer(buf), ec);
socket.read_some(net::buffer(buf), ec);
if(ec)
{
if(ec != net::error::eof)
+1 -2
View File
@@ -13,6 +13,7 @@
#include <boost/beast/websocket/detail/mask.hpp>
#include <boost/beast/core/async_op_base.hpp>
#include <boost/beast/core/bind_handler.hpp>
#include <boost/beast/core/buffer_size.hpp>
#include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/core/buffers_prefix.hpp>
#include <boost/beast/core/buffers_range.hpp>
@@ -88,7 +89,6 @@ operator()(
bool cont)
{
using beast::detail::clamp;
using net::buffer_size;
enum
{
do_nomask_nofrag,
@@ -470,7 +470,6 @@ write_some(bool fin,
ConstBufferSequence>::value,
"ConstBufferSequence requirements not met");
using beast::detail::clamp;
using net::buffer_size;
std::size_t bytes_transferred = 0;
ec = {};
// Make sure the stream is open