drain_buffer is removed (API Change):

* The drain_buffer dynamic buffer is no longer a public interface.

Actions Required:

* Replace code which uses drain_buffer. For websocket::stream,
  it is no longer necessary to manually drain the connection
  after closing.
This commit is contained in:
Vinnie Falco committed 2017-08-04 19:02:13 -07:00
1 parent 64327739f0
commit de03a1a32d
11 files changed
+6 -209

No files matched your search

-1
View File
@@ -26,7 +26,6 @@ add_executable (tests-beast-core
buffers_adapter.cpp
clamp.cpp
consuming_buffers.cpp
drain_buffer.cpp
error.cpp
file.cpp
file_posix.cpp
-1
View File
@@ -16,7 +16,6 @@ local SOURCES =
buffers_adapter.cpp
clamp.cpp
consuming_buffers.cpp
drain_buffer.cpp
error.cpp
file.cpp
file_posix.cpp
-55
View File
@@ -1,55 +0,0 @@
//
// Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/boostorg/beast
//
// Test that header file is self-contained.
#include <boost/beast/core/drain_buffer.hpp>
#include <boost/beast/core/type_traits.hpp>
#include <boost/beast/unit_test/suite.hpp>
namespace boost {
namespace beast {
static_assert(is_dynamic_buffer<drain_buffer>::value,
"DynamicBuffer requirements not met");
class drain_buffer_test : public beast::unit_test::suite
{
public:
void
run() override
{
using boost::asio::buffer_size;
drain_buffer b;
BEAST_EXPECT(buffer_size(b.prepare(0)) == 0);
BEAST_EXPECT(buffer_size(b.prepare(100)) == 100);
try
{
b.prepare(b.max_size() + 1);
fail("", __FILE__, __LINE__);
}
catch(std::length_error const&)
{
pass();
}
b.prepare(10);
BEAST_EXPECT(b.size() == 0);
b.commit(10);
BEAST_EXPECT(b.size() == 0);
b.consume(10);
BEAST_EXPECT(b.size() == 0);
b.consume(1000);
BEAST_EXPECT(b.size() == 0);
}
};
BEAST_DEFINE_TESTSUITE(beast,core,drain_buffer);
} // beast
} // boost
-2
View File
@@ -10,7 +10,6 @@
// Test that header file is self-contained.
#include <boost/beast/core/read_size.hpp>
#include <boost/beast/core/drain_buffer.hpp>
#include <boost/beast/core/flat_buffer.hpp>
#include <boost/beast/core/flat_static_buffer.hpp>
#include <boost/beast/core/multi_buffer.hpp>
@@ -37,7 +36,6 @@ public:
void
run() override
{
check<drain_buffer>();
check<flat_buffer>();
check<flat_static_buffer<1024>>();
check<multi_buffer>();
-11
View File
@@ -20,7 +20,6 @@
# include "example/server-framework/wss_ports.hpp"
#endif
#include <boost/beast/core/drain_buffer.hpp>
#include <boost/beast/websocket.hpp>
#include <boost/beast/test/yield_to.hpp>
#include <boost/beast/unit_test/suite.hpp>
@@ -107,16 +106,6 @@ public:
ws.close(beast::websocket::close_code::normal, ec);
if(! BEAST_EXPECTS(! ec, ec.message()))
return;
// VFALCO Verify the buffer's contents
drain_buffer drain;
for(;;)
{
ws.read(drain, ec);
if(ec == beast::websocket::error::closed)
break;
if(! BEAST_EXPECTS(! ec, ec.message()))
return;
}
}
void