diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-13 13:10:50 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-13 17:31:29 +0100 |
commit | 1ad42d3b00442d7122b16c72d1226f6c2b0e133f (patch) | |
tree | 9a855a4aa0ec54e5d5bec627a6d7464e45352f4b /src/libutil/http.c | |
parent | 121dd2106056508787f8046a89da38becc41c551 (diff) | |
download | rspamd-1ad42d3b00442d7122b16c72d1226f6c2b0e133f.tar.gz rspamd-1ad42d3b00442d7122b16c72d1226f6c2b0e133f.zip |
[Fix] Fix length calculations for shared memory segments
Diffstat (limited to 'src/libutil/http.c')
-rw-r--r-- | src/libutil/http.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c index 26fd3410d..57618653a 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -1233,7 +1233,7 @@ rspamd_http_connection_copy_msg (struct rspamd_http_connection *conn) } new_msg->body_buf.begin = new_msg->body_buf.str; - new_msg->body_buf.len = st.st_size; + new_msg->body_buf.len = msg->body_buf.len; new_msg->body_buf.begin = new_msg->body_buf.str + (msg->body_buf.begin - msg->body_buf.str); } @@ -1557,6 +1557,10 @@ rspamd_http_connection_write_message_common (struct rspamd_http_connection *conn (int)(msg->body_buf.begin - msg->body_buf.str)); rspamd_http_message_add_header (msg, "Shm-Offset", datebuf); + rspamd_snprintf (datebuf, sizeof (datebuf), "%z", + msg->body_buf.len); + rspamd_http_message_add_header (msg, "Shm-Length", + datebuf); } } |