Do you expect std::getline to give you more than 1 line?
No, sorry I was not clear. I expect the streambuf or read_until to have some way of telling me there's more lines to read. With that piece of code, the streambuf swallows multiple lines, but getline only gets to the first line. Only when read_until is run again, the other lines appear. I need to poll? the socket for more data, but not sure how that is done in asio.
The point is that read_until() may read *more* data than you asked, but std::getline() always extracts chars until it encounters eol or until error occurs. So you can iterate over getline() until error in the istream state -- the last extracted string would be incomplete, so it should be appended by the next result of read_until. Alternatively, you can scan the streambuf contents manually, find eol's and split the whole input as you wish.