diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-05-24 18:07:28 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-05-24 18:07:28 +0400 |
commit | 3b0487ad7ca4227133c495f26b3a6ee6a08a5831 (patch) | |
tree | 35d229b9090805cc276b8bbe3e1d55dfb27f6566 /src/plugins | |
parent | c594689abf8dad487c16615d451f11021ac8de68 (diff) | |
download | rspamd-3b0487ad7ca4227133c495f26b3a6ee6a08a5831.tar.gz rspamd-3b0487ad7ca4227133c495f26b3a6ee6a08a5831.zip |
* Fix error in raw headers parsing
* Improve speed of raw headers access
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/regexp.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 24d238d81..441a17de5 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -1267,8 +1267,6 @@ static gboolean rspamd_raw_header_exists (struct worker_task *task, GList * args, void *unused) { struct expression_argument *arg; - GList *cur; - struct raw_header *rh; if (args == NULL || task == NULL) { return FALSE; @@ -1280,16 +1278,7 @@ rspamd_raw_header_exists (struct worker_task *task, GList * args, void *unused) return FALSE; } - cur = task->raw_headers_list; - while (cur) { - rh = cur->data; - if (g_ascii_strcasecmp (rh->name, arg->data) == 0) { - return TRUE; - } - cur = g_list_next (cur); - } - - return FALSE; + return g_hash_table_lookup (task->raw_headers, arg->data) != NULL; } static gboolean |