added HTTPClientSession::flushRequest()

This commit is contained in:
Günter Obiltschnig 2019-04-05 13:00:55 +02:00
parent 42cf54b742
commit 2e26da9b34
2 changed files with 14 additions and 1 deletions

View File

@ -258,6 +258,14 @@ public:
/// This method should only be called if the request contains
/// a "Expect: 100-continue" header.
void flushRequest();
/// Flushes the request stream.
///
/// Normally this method does not need to be called.
/// It can be used to ensure the request has been
/// fully sent if receiveResponse() is not called, e.g.,
/// because the underlying socket will be detached.
void reset();
/// Resets the session and closes the socket.
///

View File

@ -283,11 +283,16 @@ std::ostream& HTTPClientSession::sendRequestImpl(const 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