Commit 8d33536e authored by legoc's avatar legoc

Do not throw an exception in BaseHttpConnection when eof while receiving the response content

parent dea94ed3
...@@ -463,9 +463,13 @@ std::string BaseHttpConnection<SocketType, ConnectionSocketType>::send(bool verb ...@@ -463,9 +463,13 @@ std::string BaseHttpConnection<SocketType, ConnectionSocketType>::send(bool verb
} while (errorCode == boost::asio::error::would_block); } while (errorCode == boost::asio::error::would_block);
// check error
if (errorCode) { if (errorCode) {
// return with exception // in case of eof, the connection was closed cleanly by the peer so that we do not generate an exception.
throw boost::system::system_error(errorCode); if (errorCode != boost::asio::error::eof) {
// return with exception
throw boost::system::system_error(errorCode);
}
} }
if (statusCode != 200) { if (statusCode != 200) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment