From 9cc592b564cf21ee9658de38ef2ec5048d4e5aae Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 5 Jan 2016 14:50:45 -0500 Subject: [PATCH] correct buffer size for deflate --- Streaming.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Streaming.cpp b/Streaming.cpp index 65148127..6834d4bb 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -764,6 +764,7 @@ namespace stream m_LocalDestination.m_Deflator.SetCompressionLevel (Z_DEFAULT_COMPRESSION); uint8_t * buf = msg->GetPayload (); buf += 4; // reserve for lengthlength + msg->len += 4; size_t size = m_LocalDestination.m_Deflator.Deflate (payload, len, buf, msg->maxLen - msg->len); if (size) { @@ -771,7 +772,7 @@ namespace stream htobe16buf (buf + 4, m_LocalDestination.GetLocalPort ()); // source port htobe16buf (buf + 6, m_Port); // destination port buf[9] = i2p::client::PROTOCOL_TYPE_STREAMING; // streaming protocol - msg->len += size + 4; + msg->len += size; msg->FillI2NPMessageHeader (eI2NPData); } else