]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Create a standard io loop in rspamadm
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 6 Aug 2021 14:17:31 +0000 (15:17 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 6 Aug 2021 14:17:31 +0000 (15:17 +0100)
src/libmime/message.c
src/rspamadm/rspamadm.c

index 9ec00d74c4928616ea23f041af22489f5cc63db1..91c5114e85781087f4fb148b280fe1580ac4297d 100644 (file)
@@ -229,7 +229,7 @@ rspamd_strip_newlines_parse (struct rspamd_task *task,
                struct rspamd_mime_text_part *part)
 {
        const gchar *p = begin, *c = begin;
-       gboolean crlf_added = FALSE;
+       gboolean crlf_added = FALSE, is_utf = IS_TEXT_PART_UTF (part);
        gboolean url_open_bracket = FALSE;
        UChar32 uc;
 
@@ -240,7 +240,7 @@ rspamd_strip_newlines_parse (struct rspamd_task *task,
        } state = normal_char;
 
        while (p < pe) {
-               if (IS_TEXT_PART_UTF (part)) {
+               if (G_LIKELY(is_utf)) {
                        gint32 off = p - begin;
                        U8_NEXT (begin, off, pe - begin, uc);
 
index 94fa4881d7bfd4dcce60546d9eaf2d450abe03d4..ae766aae64a5351f94bc57c1230acdb71dec8de0 100644 (file)
@@ -451,7 +451,7 @@ main (gint argc, gchar **argv, gchar **env)
                rspamd_log_set_log_level (rspamd_main->logger, G_LOG_LEVEL_MESSAGE);
        }
 
-       rspamd_main->event_loop = ev_default_loop (EVFLAG_SIGNALFD|EVBACKEND_ALL);
+       rspamd_main->event_loop = ev_default_loop (rspamd_config_ev_backend_get (cfg));
 
        resolver = rspamd_dns_resolver_init (rspamd_main->logger,
                        rspamd_main->event_loop,