mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
fixed #468: HTTPClientSession/HTTPResponse not forwarding exceptions
This commit is contained in:
parent
88b203f483
commit
bd9d051e46
@ -267,17 +267,13 @@ std::istream& HTTPClientSession::receiveResponse(HTTPResponse& response)
|
||||
{
|
||||
response.read(his);
|
||||
}
|
||||
catch (MessageException&)
|
||||
catch (Exception&)
|
||||
{
|
||||
close();
|
||||
if (networkException())
|
||||
networkException()->rethrow();
|
||||
else
|
||||
throw;
|
||||
}
|
||||
catch (Exception&)
|
||||
{
|
||||
close();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,6 @@ void HTTPRequest::read(std::istream& istr)
|
||||
uri.reserve(64);
|
||||
version.reserve(16);
|
||||
int ch = istr.get();
|
||||
if (istr.bad()) throw NetException("Network failure while reading HTTP request header");
|
||||
if (istr.bad()) throw NetException("Error reading HTTP request header");
|
||||
if (ch == eof) throw NoMessageException();
|
||||
while (Poco::Ascii::isSpace(ch)) ch = istr.get();
|
||||
|
@ -208,6 +208,7 @@ void HTTPResponse::read(std::istream& istr)
|
||||
std::string reason;
|
||||
|
||||
int ch = istr.get();
|
||||
if (istr.bad()) throw NetException("Error reading HTTP response header");
|
||||
if (ch == eof) throw NoMessageException();
|
||||
while (Poco::Ascii::isSpace(ch)) ch = istr.get();
|
||||
if (ch == eof) throw MessageException("No HTTP response header");
|
||||
|
Loading…
Reference in New Issue
Block a user