]> source.dussan.org Git - rspamd.git/commitdiff
* Fix some more bugs with empty parts
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 30 Jul 2009 13:39:10 +0000 (17:39 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 30 Jul 2009 13:39:10 +0000 (17:39 +0400)
src/message.c
src/plugins/regexp.c

index 643ac1710dbded2c171f475d2cd2059cc9af3473..c4027ef14133a74bc1fe1ec6b60175399b749b0d 100644 (file)
@@ -653,7 +653,7 @@ mime_foreach_callback (GMimeObject *part, gpointer user_data)
                                msg_debug ("mime_foreach_callback: found part with content-type: %s/%s", type->type, type->subtype);
                                task->parts = g_list_prepend (task->parts, mime_part);
                                /* Skip empty parts */
-                               process_text_part (task, part_content, type, (part_content->len > 0));
+                               process_text_part (task, part_content, type, (part_content->len <= 0));
                        }
                        else {
                                msg_warn ("mime_foreach_callback: write to stream failed: %d, %s", errno, strerror (errno));
index 45f07f9e7864b5d14381646ffc8595403b69783b..3613b3f6258d3430a3d8c1641e967a7e9c7dc0be 100644 (file)
@@ -512,7 +512,7 @@ optimize_regexp_expression (struct expression **e, GQueue *stack, gboolean res)
 }
 
 static gboolean
-process_regexp_expression (struct expression *expr, struct worker_task *task)
+process_regexp_expression (struct expression *expr, char *symbol, struct worker_task *task)
 {
        GQueue *stack;
        gsize cur, op1, op2;
@@ -598,7 +598,7 @@ process_regexp_expression (struct expression *expr, struct worker_task *task)
                }
        }
        else {
-               msg_warn ("process_regexp_expression: regexp expression seems to be invalid: empty stack at the end of expression");
+               msg_warn ("process_regexp_expression: regexp expression seems to be invalid: empty stack at the end of expression, symbol %s", symbol);
        }
        
        g_queue_free (stack);
@@ -611,7 +611,7 @@ process_regexp_item (struct worker_task *task, void *user_data)
 {      
        struct regexp_module_item *item = user_data;
 
-       if (process_regexp_expression (item->expr, task)) {
+       if (process_regexp_expression (item->expr, item->symbol, task)) {
                insert_result (task, regexp_module_ctx->metric, item->symbol, 1, NULL);
        }
 }
@@ -647,7 +647,7 @@ rspamd_regexp_match_number (struct worker_task *task, GList *args)
                        }
                }
                else {
-                       if (process_regexp_expression (cur->data, task)) {
+                       if (process_regexp_expression (cur->data, "regexp_match_number", task)) {
                                res ++;
                        }
                        if (res >= param_count) {