Ensure asio::streambuf's internal pointers are updated correctly after the data has been modified using std::streambuf member functions.
diff --git a/asio/include/asio/basic_streambuf.hpp b/asio/include/asio/basic_streambuf.hpp index 17157da..f8ba737 100644 --- a/asio/include/asio/basic_streambuf.hpp +++ b/asio/include/asio/basic_streambuf.hpp
@@ -236,6 +236,8 @@ */ void consume(std::size_t n) { + if (egptr() < pptr()) + setg(&buffer_[0], gptr(), pptr()); if (gptr() + n > pptr()) n = pptr() - gptr(); gbump(static_cast<int>(n));