aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-22 18:10:43 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-22 18:10:43 +0100
commitb0d3ec5f41c220a755e2f394b60481a9a5cb2ff1 (patch)
tree78cf40dedb8ec330b5b618bc7a05bdbf4723beb1 /src/libutil/str_util.h
parent261d4e4a379119d40d6cc891548c99b4b517c6d5 (diff)
downloadrspamd-b0d3ec5f41c220a755e2f394b60481a9a5cb2ff1.tar.gz
rspamd-b0d3ec5f41c220a755e2f394b60481a9a5cb2ff1.zip
[Feature] Try to guess line endings when folding headers
Diffstat (limited to 'src/libutil/str_util.h')
-rw-r--r--src/libutil/str_util.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h
index 91c80ff5d..9b9bbe0c1 100644
--- a/src/libutil/str_util.h
+++ b/src/libutil/str_util.h
@@ -20,6 +20,14 @@
#include "ucl.h"
#include "fstring.h"
+
+enum rspamd_newlines_type {
+ RSPAMD_TASK_NEWLINES_CR,
+ RSPAMD_TASK_NEWLINES_LF,
+ RSPAMD_TASK_NEWLINES_CRLF,
+ RSPAMD_TASK_NEWLINES_MAX
+};
+
/**
* Compare two memory regions of size `l` using case insensitive matching
*/
@@ -193,7 +201,7 @@ gchar * rspamd_encode_base64 (const guchar *in, gsize inlen, gint str_len,
* @return freshly allocated base64 encoded value or NULL if input is invalid
*/
gchar * rspamd_encode_base64_fold (const guchar *in, gsize inlen, gint str_len,
- gsize *outlen);
+ gsize *outlen, enum rspamd_newlines_type how);
/**
* Decode URL encoded string in-place and return new length of a string, src and dst are NULL terminated
@@ -227,7 +235,8 @@ gint rspamd_strings_levenshtein_distance (const gchar *s1, gsize s1len,
*/
GString *rspamd_header_value_fold (const gchar *name,
const gchar *value,
- guint fold_max);
+ guint fold_max,
+ enum rspamd_newlines_type how);
/**
* Search for a substring `srch` in the text `in` using Karp-Rabin algorithm