Skip to content

Commit 62841de

Browse files
committed
Ensure asio::streambuf's internal pointers are updated correctly after
the data has been modified using std::streambuf member functions.
1 parent ae0dd4d commit 62841de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

asio/include/asio/basic_streambuf.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ class basic_streambuf
236236
*/
237237
void consume(std::size_t n)
238238
{
239+
if (egptr() < pptr())
240+
setg(&buffer_[0], gptr(), pptr());
239241
if (gptr() + n > pptr())
240242
n = pptr() - gptr();
241243
gbump(static_cast<int>(n));

0 commit comments

Comments
 (0)