]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Remove unreachable code
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 25 Sep 2021 11:19:39 +0000 (12:19 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 25 Sep 2021 11:19:39 +0000 (12:19 +0100)
src/libserver/logger.h
src/libserver/logger/logger.c

index 18662d31dd85e8cf868f371bafdc9a82c9fc11f7..b646aa3fd68fc7501e87dfbdd5017f794527d8d5 100644 (file)
@@ -150,7 +150,7 @@ bool rspamd_common_logv (rspamd_logger_t *logger, gint level_flags,
  * @param mod
  * @return
  */
-guint rspamd_logger_add_debug_module (const gchar *mod);
+gint rspamd_logger_add_debug_module (const gchar *mod);
 
 /*
  * Macro to use for faster debug modules
index 07625bb91bd78b2b061e321a53628efb38d5bb4b..4fdfd3cbaff12d6bc771f8126485fc7b92d1467c 100644 (file)
@@ -449,18 +449,6 @@ rspamd_common_logv (rspamd_logger_t *rspamd_log, gint level_flags,
                /* Just fprintf message to stderr */
                if (level >= G_LOG_LEVEL_INFO) {
                        end = rspamd_vsnprintf (logbuf, sizeof (logbuf), fmt, args);
-
-                       if (!(rspamd_log->flags & RSPAMD_LOG_FLAG_RSPAMADM)) {
-                               if ((nescaped = rspamd_log_line_need_escape (logbuf, end - logbuf)) != 0) {
-                                       gsize unsecaped_len = end - logbuf;
-                                       gchar *logbuf_escaped = g_alloca (unsecaped_len + nescaped * 4);
-                                       log_line = logbuf_escaped;
-
-                                       end = rspamd_log_line_hex_escape (logbuf, unsecaped_len,
-                                                       logbuf_escaped, unsecaped_len + nescaped * 4);
-                               }
-                       }
-
                        rspamd_fprintf (stderr, "%*s\n", (gint)(end - log_line),
                                        log_line);
                }
@@ -859,13 +847,13 @@ RSPAMD_DESTRUCTOR (rspamd_debug_modules_dtor)
        }
 }
 
-guint
+gint
 rspamd_logger_add_debug_module (const gchar *mname)
 {
        struct rspamd_log_module *m;
 
        if (mname == NULL) {
-               return (guint)-1;
+               return -1;
        }
 
        if (log_modules == NULL) {