diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-05 12:15:31 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-05 13:05:45 +0100 |
commit | f0a395c9c90f7672979f7963627cdd23b0e04e36 (patch) | |
tree | d3faa294b08506ce5d441041243b33a5e9cb4e47 /src | |
parent | 0290520fca17832999e8e75e455697be5d882b8e (diff) | |
download | rspamd-f0a395c9c90f7672979f7963627cdd23b0e04e36.tar.gz rspamd-f0a395c9c90f7672979f7963627cdd23b0e04e36.zip |
[Fix] Some more changes to tag's content length calculations
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/html.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/libserver/html.c b/src/libserver/html.c index f897acd8e..d39816f87 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -1833,6 +1833,13 @@ rspamd_html_process_part_full (rspamd_mempool_t *pool, struct html_content *hc, } g_byte_array_append (dest, c, len); + if (content_tag) { + if (content_tag->content == NULL) { + content_tag->content = c; + } + + content_tag->content_length += p - c + 1; + } } c = p; @@ -1863,12 +1870,16 @@ rspamd_html_process_part_full (rspamd_mempool_t *pool, struct html_content *hc, g_byte_array_append (dest, c, len); if (content_tag) { - content_tag->content_length = len; - content_tag->content = c; - content_tag = NULL; + if (content_tag->content == NULL) { + content_tag->content = c; + } + + content_tag->content_length += p - c; } } + content_tag = NULL; + state = tag_begin; continue; } @@ -1883,6 +1894,10 @@ rspamd_html_process_part_full (rspamd_mempool_t *pool, struct html_content *hc, continue; } + if (content_tag) { + content_tag->content_length ++; + } + p ++; break; |