]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix writing of HTTP messages
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 5 Jul 2016 13:26:41 +0000 (14:26 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 5 Jul 2016 13:26:41 +0000 (14:26 +0100)
src/libutil/http.c

index 0ba8c8d2be0ee32a9bbbb84e48395c94c2b3677d..93e946ffce009a1ae83abb431dae7b09c3569dd7 100644 (file)
@@ -1928,7 +1928,7 @@ rspamd_http_connection_write_message_common (struct rspamd_http_connection *conn
 
        peer_key = msg->peer_key;
 
-       priv->wr_total = bodylen + buf->len + 2;
+       priv->wr_total = bodylen + 2;
        hdrcount = 0;
 
        HASH_ITER (hh, msg->headers, hdr, htmp) {
@@ -1947,6 +1947,7 @@ rspamd_http_connection_write_message_common (struct rspamd_http_connection *conn
                        repbuf, sizeof (repbuf), bodylen, enclen,
                        host, conn, msg,
                        &buf, priv, peer_key);
+       priv->wr_total += buf->len;
 
        /* Setup external request body */
        priv->out[0].iov_base = buf->str;