]> source.dussan.org Git - rspamd.git/commitdiff
Fix mime expressions.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 6 Oct 2015 15:17:34 +0000 (16:17 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 6 Oct 2015 15:17:34 +0000 (16:17 +0100)
src/libmime/mime_expressions.c
src/libmime/mime_expressions.h

index 6581b7362d9c72243b77925784847cd88cf1f447..d5b38437d899595be155c67cbc8420e225b8adc3 100644 (file)
@@ -125,6 +125,12 @@ struct rspamd_function_atom {
        GArray *args;   /**< its args                                                                           */
 };
 
+enum rspamd_mime_atom_type {
+       MIME_ATOM_REGEXP = 0,
+       MIME_ATOM_INTERNAL_FUNCTION,
+       MIME_ATOM_LUA_FUNCTION
+};
+
 struct rspamd_mime_atom {
        gchar *str;
        union {
@@ -132,11 +138,7 @@ struct rspamd_mime_atom {
                struct rspamd_function_atom *func;
                const gchar *lua_function;
        } d;
-       enum {
-               MIME_ATOM_REGEXP = 0,
-               MIME_ATOM_INTERNAL_FUNCTION,
-               MIME_ATOM_LUA_FUNCTION
-       } type;
+       enum rspamd_mime_atom_type type;
 };
 
 /*
@@ -923,7 +925,7 @@ rspamd_mime_expr_process_regexp (struct rspamd_regexp_atom *re,
                break;
        case REGEXP_MESSAGE:
                raw = TRUE;
-               ct = (guint8 *)task->msg.start;
+               ct = (guint8 *)task->msg.begin;
                clen = task->msg.len;
 
                ret = rspamd_mime_regexp_element_process (task, re, ct, clen, raw);
index 41e8b33ac120d9d466a5b928059da1515bd5c0a6..834f1983f667a69c79c542d198227ee964091e27 100644 (file)
@@ -16,12 +16,13 @@ extern const struct rspamd_atom_subr mime_expr_subr;
 /**
  * Function's argument
  */
+enum rspamd_expression_type {
+       EXPRESSION_ARGUMENT_NORMAL = 0,
+       EXPRESSION_ARGUMENT_BOOL,
+       EXPRESSION_ARGUMENT_REGEXP
+};
 struct expression_argument {
-       enum {
-               EXPRESSION_ARGUMENT_NORMAL = 0,
-               EXPRESSION_ARGUMENT_BOOL,
-               EXPRESSION_ARGUMENT_REGEXP
-       } type;                                                     /**< type of argument (text or other function)              */
+       enum rspamd_expression_type type;                           /**< type of argument (text or other function)              */
        void *data;                                                 /**< pointer to its data                                                    */
 };