Merge pull request #444 from samarai-jk/master

ClientConnectionPool: close pool-connection if server has closed it
This commit is contained in:
Leonid Stryzhevskyi 2021-07-20 08:35:20 +03:00 committed by GitHub
commit 6c504bfb47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,6 +142,12 @@ HttpRequestExecutor::executeOnce(const String& method,
"[oatpp::web::client::HttpRequestExecutor::executeOnce()]: Failed to read response."); "[oatpp::web::client::HttpRequestExecutor::executeOnce()]: Failed to read response.");
} }
auto con_hdr = result.headers.getAsMemoryLabel<oatpp::data::share::StringKeyLabelCI>("Connection");
if (con_hdr == "close")
{
invalidateConnection(connectionHandle);
}
auto bodyStream = oatpp::data::stream::InputStreamBufferedProxy::createShared(connection, auto bodyStream = oatpp::data::stream::InputStreamBufferedProxy::createShared(connection,
buffer, buffer,
result.bufferPosStart, result.bufferPosStart,