Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V254 #1598

Merged
merged 5 commits into from May 4, 2019
Merged

V254 #1598

Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+38 −29
Diff settings

Always

Just for now

@@ -1,3 +1,12 @@
Version 254:

* Fix data race in test::stream::connect
* Fix UB in websocket close tests
* Fix uninitalized memory use in deflate_stream
* Fix gcc-8 warning in websocket::stream

--------------------------------------------------------------------------------

Version 253:

* Fix async_detect_ssl handler type
@@ -37,7 +37,7 @@ endfunction()
#
#-------------------------------------------------------------------------------

project (Beast VERSION 253)
project (Beast VERSION 254)

set_property (GLOBAL PROPERTY USE_FOLDERS ON)
option (Beast_BUILD_EXAMPLES "Build examples" ON)
@@ -262,6 +262,9 @@ connect(stream& remote)
{
BOOST_ASSERT(! out_.lock());
BOOST_ASSERT(! remote.out_.lock());
std::lock(in_->m, remote.in_->m);
std::lock_guard<std::mutex> guard1{in_->m, std::adopt_lock};
std::lock_guard<std::mutex> guard2{remote.in_->m, std::adopt_lock};
out_ = remote.in_;
remote.out_ = in_;
in_->code = status::ok;
@@ -20,7 +20,7 @@
This is a simple integer that is incremented by one every
time a set of code changes is merged to the develop branch.
*/
#define BOOST_BEAST_VERSION 253
#define BOOST_BEAST_VERSION 254

#define BOOST_BEAST_VERSION_STRING "Boost.Beast/" BOOST_STRINGIZE(BOOST_BEAST_VERSION)

@@ -664,21 +664,22 @@ class stream<NextLayer, deflateSupported>::read_op
auto& impl = *sp;
using mutable_buffers_type = typename
DynamicBuffer::mutable_buffers_type;
boost::optional<mutable_buffers_type> mb;
BOOST_ASIO_CORO_REENTER(*this)
{
do
{
mb = beast::detail::dynamic_buffer_prepare(b_,
clamp(impl.read_size_hint_db(b_), limit_),
ec, error::buffer_overflow);
if(impl.check_stop_now(ec))
goto upcall;

// VFALCO TODO use boost::beast::bind_continuation
BOOST_ASIO_CORO_YIELD
read_some_op<read_op, mutable_buffers_type>(
std::move(*this), sp, *mb);
{
auto mb = beast::detail::dynamic_buffer_prepare(b_,
clamp(impl.read_size_hint_db(b_), limit_),
ec, error::buffer_overflow);
if(impl.check_stop_now(ec))
goto upcall;
read_some_op<read_op, mutable_buffers_type>(
std::move(*this), sp, *mb);
}

b_.commit(bytes_transferred);
bytes_written_ += bytes_transferred;
if(ec)
@@ -623,6 +623,7 @@ init()

window_ = reinterpret_cast<Byte*>(buf_.get());
prev_ = reinterpret_cast<std::uint16_t*>(buf_.get() + nwindow);
std::memset(prev_, 0, nprev);
head_ = reinterpret_cast<std::uint16_t*>(buf_.get() + nwindow + nprev);

/* We overlay pending_buf_ and d_buf_ + l_buf_. This works
@@ -350,6 +350,7 @@ class close_test : public websocket_test_suite
doFailLoop([&](test::fail_count& fc)
{
echo_server es{log};
multi_buffer b;
net::io_context ioc;
stream<test::stream> ws{ioc, fc};
ws.next_layer().connect(es.stream());
@@ -358,7 +359,6 @@ class close_test : public websocket_test_suite
ws.next_layer().append(string_view{
"\x89\x00" "\x81\x01*", 5});
std::size_t count = 0;
multi_buffer b;
ws.async_read(b,
[&](error_code ec, std::size_t)
{
@@ -391,6 +391,7 @@ class close_test : public websocket_test_suite
doFailLoop([&](test::fail_count& fc)
{
echo_server es{log};
multi_buffer b;
net::io_context ioc;
stream<test::stream> ws{ioc, fc};
ws.next_layer().connect(es.stream());
@@ -399,7 +400,6 @@ class close_test : public websocket_test_suite
ws.next_layer().append(string_view{
"\x09\x00", 2});
std::size_t count = 0;
multi_buffer b;
ws.async_read(b,
[&](error_code ec, std::size_t)
{
@@ -432,6 +432,7 @@ class close_test : public websocket_test_suite
doFailLoop([&](test::fail_count& fc)
{
echo_server es{log};
multi_buffer b;
net::io_context ioc;
stream<test::stream> ws{ioc, fc};
ws.next_layer().connect(es.stream());
@@ -440,7 +441,6 @@ class close_test : public websocket_test_suite
ws.next_layer().append(string_view{
"\x88\x00", 2});
std::size_t count = 0;
multi_buffer b;
ws.async_read(b,
[&](error_code ec, std::size_t)
{
@@ -473,6 +473,8 @@ class close_test : public websocket_test_suite
doFailLoop([&](test::fail_count& fc)
{
echo_server es{log};
std::string const s = "Hello, world!";
multi_buffer b;
net::io_context ioc;
stream<test::stream> ws{ioc, fc};
ws.next_layer().connect(es.stream());
@@ -481,7 +483,6 @@ class close_test : public websocket_test_suite
ws.next_layer().append(string_view{
"\x88\x00", 2});
std::size_t count = 0;
std::string const s = "Hello, world!";
ws.async_write(net::buffer(s),
[&](error_code ec, std::size_t n)
{
@@ -491,7 +492,6 @@ class close_test : public websocket_test_suite
BEAST_EXPECT(n == s.size());
BEAST_EXPECT(++count == 1);
});
multi_buffer b;
ws.async_read(b,
[&](error_code ec, std::size_t)
{
@@ -517,6 +517,8 @@ class close_test : public websocket_test_suite
doFailLoop([&](test::fail_count& fc)
{
echo_server es{log};
multi_buffer b;
std::string const s = "Hello, world!";
net::io_context ioc;
stream<test::stream> ws{ioc, fc};
ws.next_layer().connect(es.stream());
@@ -525,8 +527,6 @@ class close_test : public websocket_test_suite
ws.next_layer().append(string_view{
"\x89\x00", 2});
std::size_t count = 0;
multi_buffer b;
std::string const s = "Hello, world!";
ws.async_write(net::buffer(s),
[&](error_code ec, std::size_t n)
{
@@ -564,13 +564,13 @@ class close_test : public websocket_test_suite
doFailLoop([&](test::fail_count& fc)
{
echo_server es{log};
std::string const s = "Hello, world!";
multi_buffer b;
net::io_context ioc;
stream<test::stream> ws{ioc, fc};
ws.next_layer().connect(es.stream());
ws.handshake("localhost", "/");
std::size_t count = 0;
std::string const s = "Hello, world!";
multi_buffer b;
ws.async_close({},
[&](error_code ec)
{
@@ -612,13 +612,13 @@ class close_test : public websocket_test_suite
doFailLoop([&](test::fail_count& fc)
{
echo_server es{log};
multi_buffer b;
std::string const s = "Hello, world!";
net::io_context ioc;
stream<test::stream> ws{ioc, fc};
ws.next_layer().connect(es.stream());
ws.handshake("localhost", "/");
std::size_t count = 0;
std::string const s = "Hello, world!";
multi_buffer b;
ws.async_read(b,
[&](error_code ec, std::size_t)
{
@@ -673,13 +673,13 @@ class close_test : public websocket_test_suite
doFailLoop([&](test::fail_count& fc)
{
echo_server es{log};
multi_buffer b;
std::string const s = "Hello, world!";
net::io_context ioc;
stream<test::stream> ws{ioc, fc};
ws.next_layer().connect(es.stream());
ws.handshake("localhost", "/");
std::size_t count = 0;
std::string const s = "Hello, world!";
multi_buffer b;
ws.async_ping({},
[&](error_code ec)
{
@@ -3,11 +3,6 @@
Memcheck:Cond
fun:fill_window
}
{
beast_fill_window_no_init
Memcheck:Cond
fun:_ZN5beast4zlib6detail14deflate_stream11fill_windowIvEEvRNS0_8z_paramsE
}
{
Ignore OpenSSL malloc
Memcheck:Leak
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.