summaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-28 13:25:34 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-03-28 13:25:34 +0100
commita709da98c462abc9f6b08e4288525ad92698685f (patch)
tree520f84f168210f31cb9c9585db1d590cfb74882e /src/libutil/str_util.c
parent8fb798b5091a66c39aeef381ebb5afd1b345b690 (diff)
downloadrspamd-a709da98c462abc9f6b08e4288525ad92698685f.tar.gz
rspamd-a709da98c462abc9f6b08e4288525ad92698685f.zip
[Feature] Allow to fold headers on stop characters
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r--src/libutil/str_util.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index 7d346354f..238f95c87 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -918,7 +918,8 @@ GString *
rspamd_header_value_fold (const gchar *name,
const gchar *value,
guint fold_max,
- enum rspamd_newlines_type how)
+ enum rspamd_newlines_type how,
+ const gchar *fold_on_chars)
{
GString *res;
const guint default_fold_max = 76;
@@ -1019,6 +1020,13 @@ rspamd_header_value_fold (const gchar *name,
cur_len ++;
}
}
+ else if (fold_on_chars && strchr (fold_on_chars, *p) != NULL) {
+ fold_type = fold_after;
+ state = fold_token;
+ next_state = read_token;
+
+ p ++;
+ }
else {
p ++;
cur_len ++;