Opened 13 years ago

Closed 13 years ago

#3370 closed Bugs (fixed)

async_client.cpp example can eat all available VM

Reported by: egor@… Owned by: chris_kohlhoff
Milestone: Boost 1.40.0 Component: asio
Version: Boost 1.39.0 Severity: Problem
Keywords: Cc:

Description

As found at http://www.rsdn.ru/forum/cpp.applied/3517122.aspx, in russian:

boost::asio::async_read_until(socket_, response_, "\r\n",
          boost::bind(&client::handle_read_status_line, this,
            boost::asio::placeholders::error));

What if the server won't ever return "\r\n" - will response_ grow up to all available RAM?

Change History (1)

comment:1 by chris_kohlhoff, 13 years ago

Resolution: fixed
Status: newclosed

(In [60686]) Add note to examples on how to limit asio::streambuf growth. Fixes #3370.

Note: See TracTickets for help on using tickets.