aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-05-24 18:07:28 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-05-24 18:07:28 +0400
commit3b0487ad7ca4227133c495f26b3a6ee6a08a5831 (patch)
tree35d229b9090805cc276b8bbe3e1d55dfb27f6566 /src/plugins
parentc594689abf8dad487c16615d451f11021ac8de68 (diff)
downloadrspamd-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.c13
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