Fix: ZlibStream doesn't work even if libssl supports zlib.

Fixes #4848
This commit is contained in:
Gunnar Beutner 2013-10-15 12:59:29 +02:00
parent 531845c616
commit 1bce8cec97
4 changed files with 18 additions and 10 deletions

View File

@ -348,11 +348,11 @@ void ClusterListener::OpenLogFile(void)
}
StdioStream::Ptr logStream = boost::make_shared<StdioStream>(fp, true);
#ifdef ZLIB
#ifdef HAVE_BIOZLIB
m_LogFile = boost::make_shared<ZlibStream>(logStream);
#else /* ZLIB */
#else /* HAVE_BIOZLIB */
m_LogFile = logStream;
#endif /* ZLIB */
#endif /* HAVE_BIOZLIB */
m_LogMessageCount = 0;
m_LogMessageTimestamp = 0;
}
@ -435,11 +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
#ifdef HAVE_BIOZLIB
ZlibStream::Ptr lstream = boost::make_shared<ZlibStream>(logStream);
#else /* ZLIB */
#else /* HAVE_BIOZLIB */
Stream::Ptr lstream = logStream;
#endif /* ZLIB */
#endif /* HAVE_BIOZLIB */
String message;
while (true) {

View File

@ -113,6 +113,14 @@ AC_CHECK_LIB(ws2_32, getsockname)
AC_CHECK_LIB(shlwapi, PathRemoveFileSpecA)
AC_CHECK_FUNCS([backtrace_symbols execvpe pipe2 pthread_set_name_np pthread_setname_np])
AC_TRY_LINK([#include <openssl/evp.h>
#include <openssl/bio.h>
#include <openssl/comp.h>], [BIO_f_zlib();], ac_cv_lib_biozlib="yes")
if test "$ac_cv_lib_biozlib" = "yes"; then
AC_DEFINE(HAVE_BIOZLIB, 1,
[Define if BIO_f_zlib is available])
fi
CFLAGS="$CFLAGS -Wall -Wextra"
CXXFLAGS="$CXXFLAGS -Wall -Wextra"

View File

@ -21,7 +21,7 @@
#include "base/objectlock.h"
#include <boost/make_shared.hpp>
#ifdef ZLIB
#ifdef HAVE_BIOZLIB
using namespace icinga;
@ -79,4 +79,4 @@ bool ZlibStream::IsEof(void) const
return BIO_eof(m_BIO);
}
#endif /* ZLIB */
#endif /* HAVE_BIOZLIB */

View File

@ -24,7 +24,7 @@
#include "base/stream_bio.h"
#include <iostream>
#ifdef ZLIB
#ifdef HAVE_BIOZLIB
namespace icinga {
@ -50,6 +50,6 @@ private:
}
#endif /* ZLIB */
#endif /* HAVE_BIOZLIB */
#endif /* ZLIBSTREAM_H */