aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/http.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-05-07 12:21:15 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-05-07 12:21:15 +0100
commit2eb9f5304f4f0b06798214f2840f57c9bd908843 (patch)
tree8dd329c3c62e080d387cbbb0f27d70185693512b /src/libutil/http.c
parentfae5e1ba7f95bee14efd914a8be56cb1609df90a (diff)
downloadrspamd-2eb9f5304f4f0b06798214f2840f57c9bd908843.tar.gz
rspamd-2eb9f5304f4f0b06798214f2840f57c9bd908843.zip
[Fix] Adjust body/body_buf when stealing encrypted message
Diffstat (limited to 'src/libutil/http.c')
-rw-r--r--src/libutil/http.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c
index d15c7d99b..fef9cb73c 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -1172,6 +1172,13 @@ rspamd_http_connection_steal_msg (struct rspamd_http_connection *conn)
msg->peer_key = NULL;
}
priv->msg = NULL;
+
+ /* We also might need to adjust body/body_buf */
+ if (msg->body_buf.begin > msg->body->str) {
+ memmove (msg->body->str, msg->body_buf.begin, msg->body_buf.len);
+ msg->body->len = msg->body_buf.len;
+ msg->body_buf.begin = msg->body->str;
+ }
}
return msg;
@@ -1192,6 +1199,8 @@ rspamd_http_connection_copy_msg (struct rspamd_http_connection *conn)
if (msg->body) {
new_msg->body = rspamd_fstring_new_init (msg->body->str,
msg->body->len);
+ new_msg->body_buf.begin = msg->body_buf.begin;
+ new_msg->body_buf.len = msg->body_buf.len;
}
if (msg->url) {