]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Store content length for HTML tags
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 5 Aug 2016 08:45:32 +0000 (09:45 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 5 Aug 2016 08:45:32 +0000 (09:45 +0100)
src/libserver/html.c
src/libserver/html.h

index 57a0dfa88b9175205607d4b8579d162c75c6786a..a65dd9a956e24adc514dd1284b9054c478e1d203 100644 (file)
@@ -1830,6 +1830,10 @@ rspamd_html_process_part_full (rspamd_mempool_t *pool, struct html_content *hc,
                                                save_space = FALSE;
                                        }
                                }
+
+                               if (cur_tag) {
+                                       cur_tag->content_length ++;
+                               }
                        }
                        else {
                                if (c != p) {
index b3d8738d76235d928d506e652d4895d84d3472e4..eb8ca80700cff90a55ae5d4ffb18e18abdc33833 100644 (file)
@@ -80,6 +80,7 @@ struct html_block {
 struct html_tag {
        gint id;
        gint flags;
+       gsize content_length;
        struct html_tag_component name;
        GQueue *params;
        gpointer extra; /** Additional data associated with tag (e.g. image) */