Examples clear the HTTP message before reading

fix #1043
This commit is contained in:
Vinnie Falco
2018-02-26 20:25:27 -08:00
parent d6c11a824a
commit 04ced3b954
8 changed files with 32 additions and 0 deletions

View File

@@ -287,6 +287,10 @@ public:
void
do_read()
{
// Make the request empty before reading,
// otherwise the operation behavior is undefined.
req_ = {};
// Read a request
http::async_read(socket_, buffer_, req_,
boost::asio::bind_executor(