mirror of https://github.com/Icinga/icinga2.git
Merge pull request #7020 from Icinga/bugfix/elasticsearchwriter-oom-7018
ElasticsearchWriter: don't leak sockets
This commit is contained in:
commit
00b8fb1f49
|
@ -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. */
|
||||
|
|
Loading…
Reference in New Issue