aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/message.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-23 20:06:34 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-23 20:06:34 +0100
commit3944ae59e74c31103d3bd10fe4dd025b05d74679 (patch)
tree6556701646c1d1b3d35d5b8766236a1995ef88bf /src/libmime/message.c
parente9c773e6bb0e09b4802f3cb06b93b7a082e464ed (diff)
downloadrspamd-3944ae59e74c31103d3bd10fe4dd025b05d74679.tar.gz
rspamd-3944ae59e74c31103d3bd10fe4dd025b05d74679.zip
[Project] Further changes in unicode operations
* Normalise unicode * Add normality flag for text parts * Store UCS in text parts * Rework unicode conversions and operations
Diffstat (limited to 'src/libmime/message.c')
-rw-r--r--src/libmime/message.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index 5d9cf19d1..e6cb63504 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -661,7 +661,6 @@ rspamd_message_process_text_part (struct rspamd_task *task,
{
struct rspamd_mime_text_part *text_part;
rspamd_ftok_t html_tok, xhtml_tok;
- GByteArray *part_content;
gboolean found_html = FALSE, found_txt = FALSE;
enum rspamd_action_type act;
@@ -756,22 +755,21 @@ rspamd_message_process_text_part (struct rspamd_task *task,
return;
}
- part_content = rspamd_mime_text_part_maybe_convert (task, text_part);
+ rspamd_mime_text_part_maybe_convert (task, text_part);
- if (part_content == NULL) {
+ if (text_part->utf_raw_content == NULL) {
return;
}
text_part->html = rspamd_mempool_alloc0 (task->task_pool,
sizeof (*text_part->html));
text_part->mime_part = mime_part;
- text_part->utf_raw_content = part_content;
text_part->flags |= RSPAMD_MIME_TEXT_PART_FLAG_BALANCED;
text_part->content = rspamd_html_process_part_full (
task->task_pool,
text_part->html,
- part_content,
+ text_part->utf_raw_content,
&text_part->exceptions,
task->urls,
task->emails);
@@ -802,15 +800,14 @@ rspamd_message_process_text_part (struct rspamd_task *task,
return;
}
- text_part->content = rspamd_mime_text_part_maybe_convert (task,
- text_part);
- text_part->utf_raw_content = text_part->content;
+ rspamd_mime_text_part_maybe_convert (task, text_part);
- if (text_part->content != NULL) {
+ if (text_part->utf_raw_content != NULL) {
/*
* We ignore unconverted parts from now as it is dangerous
* to treat them as text parts
*/
+ text_part->content = text_part->utf_raw_content;
g_ptr_array_add (task->text_parts, text_part);
}
else {