mirror of https://github.com/Icinga/icinga2.git
parent
d3314d5840
commit
d36e2ebd1a
|
@ -348,7 +348,11 @@ void ClusterListener::OpenLogFile(void)
|
|||
}
|
||||
|
||||
StdioStream::Ptr logStream = boost::make_shared<StdioStream>(fp, true);
|
||||
#ifdef ZLIB
|
||||
m_LogFile = boost::make_shared<ZlibStream>(logStream);
|
||||
#else /* ZLIB */
|
||||
m_LogFile = logStream;
|
||||
#endif /* ZLIB */
|
||||
m_LogMessageCount = 0;
|
||||
m_LogMessageTimestamp = 0;
|
||||
}
|
||||
|
@ -431,7 +435,11 @@ void ClusterListener::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Ptr
|
|||
|
||||
std::fstream *fp = new std::fstream(path.CStr(), std::fstream::in);
|
||||
StdioStream::Ptr logStream = boost::make_shared<StdioStream>(fp, true);
|
||||
#ifdef ZLIB
|
||||
ZlibStream::Ptr lstream = boost::make_shared<ZlibStream>(logStream);
|
||||
#else /* ZLIB */
|
||||
Stream::Ptr lstream = logStream;
|
||||
#endif /* ZLIB */
|
||||
|
||||
String message;
|
||||
while (true) {
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#include "base/objectlock.h"
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
#ifdef ZLIB
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
extern "C" BIO_METHOD *BIO_f_zlib(void);
|
||||
|
@ -76,3 +78,5 @@ bool ZlibStream::IsEof(void) const
|
|||
|
||||
return BIO_eof(m_BIO);
|
||||
}
|
||||
|
||||
#endif /* ZLIB */
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#include "base/stream_bio.h"
|
||||
#include <iostream>
|
||||
|
||||
#ifdef ZLIB
|
||||
|
||||
namespace icinga {
|
||||
|
||||
class ZlibStream : public Stream
|
||||
|
@ -48,4 +50,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#endif /* ZLIB */
|
||||
|
||||
#endif /* ZLIBSTREAM_H */
|
||||
|
|
Loading…
Reference in New Issue