mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-02 15:41:36 +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)
|
||||
{
|
||||
message += '\n';
|
||||
status = receiveStatusLine(message, MAX_LINE_LENGTH);
|
||||
status = receiveStatusLine(message, message.length() + MAX_LINE_LENGTH);
|
||||
}
|
||||
}
|
||||
return status;
|
||||
|
@ -193,8 +193,9 @@ void HTTPClientSession::setKeepAliveTimeout(const Poco::Timespan& timeout)
|
||||
|
||||
std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
|
||||
{
|
||||
clearException();
|
||||
_pRequestStream = 0;
|
||||
_pResponseStream = 0;
|
||||
clearException();
|
||||
_responseReceived = false;
|
||||
|
||||
bool keepAlive = getKeepAlive();
|
||||
@ -259,11 +260,16 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request)
|
||||
}
|
||||
|
||||
|
||||
std::istream& HTTPClientSession::receiveResponse(HTTPResponse& response)
|
||||
void HTTPClientSession::flushRequest()
|
||||
{
|
||||
_pRequestStream = 0;
|
||||
if (networkException()) networkException()->rethrow();
|
||||
}
|
||||
|
||||
|
||||
std::istream& HTTPClientSession::receiveResponse(HTTPResponse& response)
|
||||
{
|
||||
flushRequest();
|
||||
if (!_responseReceived)
|
||||
{
|
||||
do
|
||||
@ -354,13 +360,14 @@ int HTTPClientSession::write(const char* buffer, std::streamsize length)
|
||||
_reconnect = false;
|
||||
return rc;
|
||||
}
|
||||
catch (NetException&)
|
||||
catch (IOException&)
|
||||
{
|
||||
if (_reconnect)
|
||||
{
|
||||
close();
|
||||
reconnect();
|
||||
int rc = HTTPSession::write(buffer, length);
|
||||
clearException();
|
||||
_reconnect = false;
|
||||
return rc;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user