You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If two or more HTTP responses are read into the parser buffer, and the parser::prepare() buffer returns a non-empty mutable buffer, then the subsequent async_read_some operation on the stream will block indefinitely, assuming all responses have already been delivered. For example:
This happens because the leftover data in the buffer isn't fully parsed when parser::prepare() is called. As a result, we can't determine if the buffer contains a complete or a partial message. To prevent indefinite blocking, we should assume that any leftover data after parsing a message might indicate a complete message. Therefore, we should avoid initiating another read attempt if leftovers are present.
The flow would be as follows:
pr.start();
if (pr.need_data())
{
// Prepare buffer and read from the stream
}
pr.parse();
The text was updated successfully, but these errors were encountered:
You should show the smallest possible example code which uses the parser to extract two complete messages which are already stuffed into its input buffer
You should show the smallest possible example code which uses the parser to extract two complete messages which are already stuffed into its input buffer
If two or more HTTP responses are read into the
parser
buffer, and theparser::prepare()
buffer returns a non-empty mutable buffer, then the subsequentasync_read_some
operation on the stream will block indefinitely, assuming all responses have already been delivered. For example:This happens because the leftover data in the buffer isn't fully parsed when
parser::prepare()
is called. As a result, we can't determine if the buffer contains a complete or a partial message. To prevent indefinite blocking, we should assume that any leftover data after parsing a message might indicate a complete message. Therefore, we should avoid initiating another read attempt if leftovers are present.The flow would be as follows:
The text was updated successfully, but these errors were encountered: