diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-02-23 20:21:38 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-02-23 20:21:38 +0300 |
commit | 44d9cd1d59b340e8111ae57dafd06f65734b12d1 (patch) | |
tree | 981154fe56072150f4f31b4f4a7ab288d074eb4a /src/message.c | |
parent | cb34e117a397a6d27734cf3564001bfec97ec0ea (diff) | |
download | rspamd-44d9cd1d59b340e8111ae57dafd06f65734b12d1.tar.gz rspamd-44d9cd1d59b340e8111ae57dafd06f65734b12d1.zip |
Save separator inside raw_header struct.
Requested by: Victor Ustugov
Diffstat (limited to 'src/message.c')
-rw-r--r-- | src/message.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/message.c b/src/message.c index 38f9a663e..2056e87ca 100644 --- a/src/message.c +++ b/src/message.c @@ -499,6 +499,7 @@ process_raw_headers (struct worker_task *task) new->name = tmp; p ++; state = 2; + c = p; } else if (g_ascii_isspace (*p)) { /* Not header but some garbadge */ @@ -513,20 +514,34 @@ process_raw_headers (struct worker_task *task) /* We got header's name, so skip any \t or spaces */ if (*p == '\t') { new->tab_separated = TRUE; + new->empty_separator = FALSE; p ++; } else if (*p == ' '){ + new->empty_separator = FALSE; p ++; } else if (*p == '\n' || *p == '\r') { /* Process folding */ state = 99; + l = p - c - 1; + if (l > 0) { + tmp = memory_pool_alloc (task->task_pool, l + 1); + rspamd_strlcpy (tmp, c, l + 1); + new->separator = tmp; + } next_state = 3; err_state = 5; c = p; } else { /* Process value */ + l = p - c - 1; + if (l > 0) { + tmp = memory_pool_alloc (task->task_pool, l + 1); + rspamd_strlcpy (tmp, c, l + 1); + new->separator = tmp; + } c = p; state = 3; } |