mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-03 07:52:29 +02:00
fixed GH #2570: DialogSocket: receiveStatusMessage() - line length limit applies to entire multi-line message
This commit is contained in:
parent
03ced50f88
commit
479564069e
@ -161,7 +161,7 @@ int DialogSocket::receiveStatusMessage(std::string& message)
|
|||||||
while (status <= 0)
|
while (status <= 0)
|
||||||
{
|
{
|
||||||
message += '\n';
|
message += '\n';
|
||||||
status = receiveStatusLine(message, MAX_LINE_LENGTH);
|
status = receiveStatusLine(message, message.length() + MAX_LINE_LENGTH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
@ -193,8 +193,9 @@ void HTTPClientSession::setKeepAliveTimeout(const Poco::Timespan& timeout)
|
|||||||
|
|
||||||
std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
|
std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
|
||||||
{
|
{
|
||||||
clearException();
|
_pRequestStream = 0;
|
||||||
_pResponseStream = 0;
|
_pResponseStream = 0;
|
||||||
|
clearException();
|
||||||
_responseReceived = false;
|
_responseReceived = false;
|
||||||
|
|
||||||
bool keepAlive = getKeepAlive();
|
bool keepAlive = getKeepAlive();
|
||||||
@ -259,11 +260,16 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
std::istream& HTTPClientSession::receiveResponse(HTTPResponse& response)
|
void HTTPClientSession::flushRequest()
|
||||||
{
|
{
|
||||||
_pRequestStream = 0;
|
_pRequestStream = 0;
|
||||||
if (networkException()) networkException()->rethrow();
|
if (networkException()) networkException()->rethrow();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::istream& HTTPClientSession::receiveResponse(HTTPResponse& response)
|
||||||
|
{
|
||||||
|
flushRequest();
|
||||||
if (!_responseReceived)
|
if (!_responseReceived)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
@ -354,13 +360,14 @@ int HTTPClientSession::write(const char* buffer, std::streamsize length)
|
|||||||
_reconnect = false;
|
_reconnect = false;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
catch (NetException&)
|
catch (IOException&)
|
||||||
{
|
{
|
||||||
if (_reconnect)
|
if (_reconnect)
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
reconnect();
|
reconnect();
|
||||||
int rc = HTTPSession::write(buffer, length);
|
int rc = HTTPSession::write(buffer, length);
|
||||||
|
clearException();
|
||||||
_reconnect = false;
|
_reconnect = false;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user