diff --git a/CHANGELOG.md b/CHANGELOG.md index 010173b5..f23b068e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Version 145: * Rename some detail functions * Refactor basic_fields allocator internals * Refactor HTTP async read composed operations +* null_buffers is deprecated -------------------------------------------------------------------------------- diff --git a/include/boost/beast/http/empty_body.hpp b/include/boost/beast/http/empty_body.hpp index 1845a229..1f1bf7fb 100644 --- a/include/boost/beast/http/empty_body.hpp +++ b/include/boost/beast/http/empty_body.hpp @@ -100,7 +100,7 @@ struct empty_body struct writer { using const_buffers_type = - boost::asio::null_buffers; + boost::asio::const_buffer; template explicit diff --git a/include/boost/beast/websocket/impl/teardown.ipp b/include/boost/beast/websocket/impl/teardown.ipp index 8f4475f2..4025e753 100644 --- a/include/boost/beast/websocket/impl/teardown.ipp +++ b/include/boost/beast/websocket/impl/teardown.ipp @@ -124,8 +124,8 @@ operator()(error_code ec, std::size_t) } do_read: - return s_.async_read_some( - boost::asio::null_buffers{}, + return s_.async_wait( + boost::asio::ip::tcp::socket::wait_read, std::move(*this)); } if(role_ == role_type::client) diff --git a/test/beast/core/buffers_prefix.cpp b/test/beast/core/buffers_prefix.cpp index e4c030c2..39e8f5eb 100644 --- a/test/beast/core/buffers_prefix.cpp +++ b/test/beast/core/buffers_prefix.cpp @@ -131,14 +131,14 @@ public: }} } - void testNullBuffers() + void testEmptyBuffers() { using boost::asio::buffer_copy; using boost::asio::buffer_size; - using boost::asio::null_buffers; - auto pb0 = buffers_prefix(0, null_buffers{}); + using boost::asio::mutable_buffer; + auto pb0 = buffers_prefix(0, mutable_buffer{}); BEAST_EXPECT(buffer_size(pb0) == 0); - auto pb1 = buffers_prefix(1, null_buffers{}); + auto pb1 = buffers_prefix(1, mutable_buffer{}); BEAST_EXPECT(buffer_size(pb1) == 0); BEAST_EXPECT(buffer_copy(pb0, pb1) == 0); @@ -175,7 +175,7 @@ public: { testMatrix(); testMatrix(); - testNullBuffers(); + testEmptyBuffers(); testIterator(); } }; diff --git a/test/beast/core/buffers_suffix.cpp b/test/beast/core/buffers_suffix.cpp index 3d3c87df..383d2a80 100644 --- a/test/beast/core/buffers_suffix.cpp +++ b/test/beast/core/buffers_suffix.cpp @@ -143,16 +143,16 @@ public: } void - testNullBuffers() + testEmptyBuffers() { using boost::asio::buffer_copy; using boost::asio::buffer_size; - using boost::asio::null_buffers; - buffers_suffix cb( - null_buffers{}); + using boost::asio::mutable_buffer; + buffers_suffix cb( + mutable_buffer{}); BEAST_EXPECT(buffer_size(cb) == 0); - buffers_suffix cb2( - null_buffers{}); + buffers_suffix cb2( + mutable_buffer{}); BEAST_EXPECT(buffer_copy(cb2, cb) == 0); } @@ -174,7 +174,7 @@ public: testMatrix(); testDefaultCtor(); testInPlace(); - testNullBuffers(); + testEmptyBuffers(); testIterator(); } }; diff --git a/test/beast/websocket/write.cpp b/test/beast/websocket/write.cpp index afa52700..9642ac86 100644 --- a/test/beast/websocket/write.cpp +++ b/test/beast/websocket/write.cpp @@ -66,7 +66,7 @@ public: doTest(pmd, [&](ws_type& ws) { ws.text(true); - w.write(ws, boost::asio::null_buffers{}); + w.write(ws, boost::asio::const_buffer{}); multi_buffer b; w.read(ws, b); BEAST_EXPECT(ws.got_text()); @@ -549,7 +549,7 @@ public: if(! BEAST_EXPECTS(! ec, ec.message())) break; ws.async_write_some(false, - boost::asio::null_buffers{}, + boost::asio::const_buffer{}, [&](error_code, std::size_t) { fail();