improved HTTPClientSession error handling for network errors handling during sending the request

This commit is contained in:
Guenter Obiltschnig
2014-10-02 22:29:25 +02:00
parent cd67863852
commit 30e26b0d96
3 changed files with 13 additions and 1 deletions

View File

@@ -163,6 +163,7 @@ void HTTPClientSession::setKeepAliveTimeout(const Poco::Timespan& timeout)
std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
{
clearException();
_pResponseStream = 0;
bool keepAlive = getKeepAlive();
@@ -229,6 +230,7 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
std::istream& HTTPClientSession::receiveResponse(HTTPResponse& response)
{
_pRequestStream = 0;
if (networkException()) networkException()->rethrow();
do
{