aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-05-02 12:28:43 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-05-02 12:28:43 +0100
commitde4532aba29f10943776f85ae625633eb8c8406f (patch)
tree701d001653ae5ff56164c713a98d4d25c1813cce /src
parente6ddee95a731f41a9cca17fe5082bfcda9623924 (diff)
downloadrspamd-de4532aba29f10943776f85ae625633eb8c8406f.tar.gz
rspamd-de4532aba29f10943776f85ae625633eb8c8406f.zip
Handle HTTP headers during task processing.
Diffstat (limited to 'src')
-rw-r--r--src/libserver/protocol.c9
-rw-r--r--src/libserver/protocol.h15
-rw-r--r--src/libserver/task.c2
3 files changed, 18 insertions, 8 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index 8f42a08ce..df5e9723e 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -223,8 +223,9 @@ err:
return FALSE;
}
-static gboolean
-rspamd_protocol_handle_headers (struct rspamd_task *task, struct rspamd_http_message *msg)
+gboolean
+rspamd_protocol_handle_headers (struct rspamd_task *task,
+ struct rspamd_http_message *msg)
{
gchar *headern, *err, *tmp;
gboolean res = TRUE;
@@ -401,10 +402,6 @@ rspamd_protocol_handle_request (struct rspamd_task *task,
ret = rspamd_protocol_handle_url (task, msg);
}
- if (ret) {
- ret = rspamd_protocol_handle_headers (task, msg);
- }
-
return ret;
}
diff --git a/src/libserver/protocol.h b/src/libserver/protocol.h
index b3643ac7a..aed45752c 100644
--- a/src/libserver/protocol.h
+++ b/src/libserver/protocol.h
@@ -21,19 +21,30 @@
struct metric;
/**
+ * Process headers into HTTP message and set appropriate task fields
+ * @param task
+ * @param msg
+ * @return
+ */
+gboolean rspamd_protocol_handle_headers (struct rspamd_task *task,
+ struct rspamd_http_message *msg);
+
+/**
* Process HTTP request to the task structure
* @param task
* @param msg
* @return
*/
-gboolean rspamd_protocol_handle_request (struct rspamd_task *task, struct rspamd_http_message *msg);
+gboolean rspamd_protocol_handle_request (struct rspamd_task *task,
+ struct rspamd_http_message *msg);
/**
* Write task results to http message
* @param msg
* @param task
*/
-void rspamd_protocol_http_reply (struct rspamd_http_message *msg, struct rspamd_task *task);
+void rspamd_protocol_http_reply (struct rspamd_http_message *msg,
+ struct rspamd_task *task);
/**
* Write reply for specified task command
diff --git a/src/libserver/task.c b/src/libserver/task.c
index 27ddf63ca..00ff9003d 100644
--- a/src/libserver/task.c
+++ b/src/libserver/task.c
@@ -290,6 +290,8 @@ rspamd_task_process (struct rspamd_task *task,
/* We got body, set wanna_die flag */
task->s->wanna_die = TRUE;
+ rspamd_protocol_handle_headers (task, msg);
+
r = process_message (task);
if (r == -1) {
msg_warn ("processing of message failed");