]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Handle HTTP headers during task processing.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 2 May 2014 11:28:43 +0000 (12:28 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 2 May 2014 11:28:43 +0000 (12:28 +0100)
src/libserver/protocol.c
src/libserver/protocol.h
src/libserver/task.c

index 8f42a08cea9a364bea72f3777d9722bf44d28b25..df5e9723e70537f3ac7b8b51bcccd4e5646b44c6 100644 (file)
@@ -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;
 }
 
index b3643ac7a6e3c47a283e73834796bfa6dae84561..aed45752ca9ef4eb9a4fbc75d907b573a5d8395f 100644 (file)
 
 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
index 27ddf63ca3b2c0824ff9612f23c6af5d20742cdd..00ff9003d4cfd91a995324bc252f0dc843b6a08f 100644 (file)
@@ -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");