From: Vsevolod Stakhov Date: Fri, 6 Aug 2021 14:17:31 +0000 (+0100) Subject: [Minor] Create a standard io loop in rspamadm X-Git-Tag: 3.0~41 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d4871e22d6a02939283e50407d4d839f2119a9b7;p=rspamd.git [Minor] Create a standard io loop in rspamadm --- diff --git a/src/libmime/message.c b/src/libmime/message.c index 9ec00d74c..91c5114e8 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -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); diff --git a/src/rspamadm/rspamadm.c b/src/rspamadm/rspamadm.c index 94fa4881d..ae766aae6 100644 --- a/src/rspamadm/rspamadm.c +++ b/src/rspamadm/rspamadm.c @@ -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,