Change consume to full buffer recreate (#899)

This commit is contained in:
Alex Kremer
2023-10-06 14:57:05 +01:00
committed by GitHub
parent 4fe868aaeb
commit ac752c656e

View File

@@ -212,8 +212,8 @@ public:
if (dead())
return;
// Clear the buffer
buffer_.consume(buffer_.size());
// Note: use entirely new buffer so previously used, potentially large, capacity is deallocated
buffer_ = boost::beast::flat_buffer{};
derived().ws().async_read(buffer_, boost::beast::bind_front_handler(&WsBase::onRead, this->shared_from_this()));
}