diff options
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/mime_headers.c | 10 | ||||
-rw-r--r-- | src/libmime/mime_headers.h | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index 88675a629..3deb26a08 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -948,6 +948,16 @@ rspamd_message_get_header_array (struct rspamd_task *task, const gchar *field, field, need_modified); } +gsize +rspamd_mime_headers_count (struct rspamd_mime_headers_table *hdrs) +{ + if (hdrs) { + return kh_size (&hdrs->htb); + } + + return 0; +} + static void rspamd_message_headers_dtor (struct rspamd_mime_headers_table *hdrs) { diff --git a/src/libmime/mime_headers.h b/src/libmime/mime_headers.h index 07a64c31e..7174f9e8f 100644 --- a/src/libmime/mime_headers.h +++ b/src/libmime/mime_headers.h @@ -161,6 +161,13 @@ struct rspamd_mime_headers_table * rspamd_message_headers_ref (struct rspamd_mim struct rspamd_mime_headers_table* rspamd_message_headers_new (void); /** + * Returns size for a headers table + * @param hdrs + * @return + */ +gsize rspamd_mime_headers_count (struct rspamd_mime_headers_table *hdrs); + +/** * Strip rfc822 CFWS sequences from a string in place * @param input input * @param len length of the input |