aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-08 08:25:04 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-08 09:41:57 +0000
commit6d7d30ec8775695da2c5ca87d532785cedd192ea (patch)
tree3f31cccbc7b8b8070494de372df2aad700fc1b08 /src
parent89c4bcc695297c44bd009db379631c940d1d2390 (diff)
downloadrspamd-6d7d30ec8775695da2c5ca87d532785cedd192ea.tar.gz
rspamd-6d7d30ec8775695da2c5ca87d532785cedd192ea.zip
[Minor] Add workaround for Thai characters on CentOS 6
Diffstat (limited to 'src')
-rw-r--r--src/libmime/message.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index 43158d083..0604f0ce7 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -33,6 +33,7 @@
#endif
#include <math.h>
+#include <unicode/uchar.h>
#define GTUBE_SYMBOL "GTUBE"
@@ -202,7 +203,19 @@ rspamd_mime_part_create_words (struct rspamd_task *task,
enum rspamd_tokenize_type tok_type;
if (IS_PART_UTF (part)) {
+
+#if U_ICU_VERSION_MAJOR_NUM < 50
+ /* Hack to prevent hang with Thai in old libicu */
+ if (part->unicode_scripts & RSPAMD_UNICODE_THAI) {
+ msg_info_task ("enable workaround for Thai characters for old libicu")
+ tok_type = RSPAMD_TOKENIZE_RAW;
+ }
+ else {
+ tok_type = RSPAMD_TOKENIZE_UTF;
+ }
+#else
tok_type = RSPAMD_TOKENIZE_UTF;
+#endif
}
else {
tok_type = RSPAMD_TOKENIZE_RAW;