]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Don't use doLog.hh in recursor, ifdef around it.
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 8 Mar 2019 09:11:51 +0000 (10:11 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 8 Mar 2019 09:11:51 +0000 (10:11 +0100)
pdns/fstrm_logger.cc
pdns/recursordist/Makefile.am
pdns/recursordist/dolog.hh [deleted symlink]

index 7df889b049209d1eb48d1332bf2a27e13aec62d5..62ccd72ebd10a5b3f52c9b5ebd7b3ef89c66f6d9 100644 (file)
@@ -3,7 +3,12 @@
 
 #include "config.h"
 #include "fstrm_logger.hh"
+
+#ifdef RECURSOR
+#include "logger.hh"
+#else
 #include "dolog.hh"
+#endif
 
 #define DNSTAP_CONTENT_TYPE            "protobuf:dnstap.Dnstap"
 
@@ -176,7 +181,11 @@ void FrameStreamLogger::queueData(const std::string& data)
   }
   uint8_t *frame = (uint8_t*)malloc(data.length());
   if (!frame) {
+#ifdef RECURSOR
+    g_log<<Logger::Warning<<"FrameStreamLogger: cannot allocate memory for stream."<<std::endl;
+#else
     warnlog("FrameStreamLogger: cannot allocate memory for stream.");
+#endif
     return;
   }
   memcpy(frame, data.c_str(), data.length());
@@ -188,11 +197,19 @@ void FrameStreamLogger::queueData(const std::string& data)
     // Frame successfully queued.
   } else if (res == fstrm_res_again) {
     free(frame);
+#ifdef RECURSOR
+    g_log<<Logger::Warning<<"FrameStreamLogger: queue full, dropping."<<std::endl;
+#else
     warnlog("FrameStreamLogger: queue full, dropping.");
-  } else {
+#endif
+ } else {
     // Permanent failure.
     free(frame);
+#ifdef RECURSOR
+    g_log<<Logger::Warning<<"FrameStreamLogger: submitting to queue failed."<<std::endl;
+#else
     warnlog("FrameStreamLogger: submitting to queue failed.");
+#endif
   }
 }
 
index 9ebce5994feff952d0bf783b427db8e2d6f9f1c8..ffbffa631682bb8d7223dff4de50777cc6fea5aa 100644 (file)
@@ -390,7 +390,7 @@ endif
 
 if FSTRM
 pdns_recursor_SOURCES += \
-       dnstap.cc dnstap.hh fstrm_logger.cc fstrm_logger.hh dolog.hh
+       dnstap.cc dnstap.hh fstrm_logger.cc fstrm_logger.hh
 
 pdns_recursor_LDADD += \
        $(FSTRM_LIBS)
diff --git a/pdns/recursordist/dolog.hh b/pdns/recursordist/dolog.hh
deleted file mode 120000 (symlink)
index e458b07..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../dolog.hh
\ No newline at end of file