ElasticsearchWriter: don't leak sockets

refs #7018
This commit is contained in:
Alexander A. Klimov 2019-03-15 13:15:24 +01:00
parent 2de8bac588
commit b2e2b587da
1 changed files with 3 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#include "icinga/compatutility.hpp"
#include "icinga/service.hpp"
#include "icinga/checkcommand.hpp"
#include "base/defer.hpp"
#include "base/tcpsocket.hpp"
#include "base/stream.hpp"
#include "base/base64.hpp"
@ -445,6 +446,8 @@ void ElasticsearchWriter::SendRequest(const String& body)
if (!stream)
return;
Defer close ([&stream]() { stream->Close(); });
HttpRequest req(stream);
/* Specify required headers by Elasticsearch. */