From dd679c261c3e8445de1a762f9156a331a963b42b Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 13 Jan 2014 21:18:32 -0500 Subject: [PATCH] set minimum comression level --- Streaming.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Streaming.cpp b/Streaming.cpp index a737e622..b702e56a 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -404,6 +404,7 @@ namespace stream { I2NPMessage * msg = NewI2NPMessage (); CryptoPP::Gzip compressor; + compressor.SetDeflateLevel (CryptoPP::Gzip::MIN_DEFLATE_LEVEL); compressor.Put (payload, len); compressor.MessageEnd(); int size = compressor.MaxRetrievable (); @@ -411,6 +412,7 @@ namespace stream *(uint32_t *)buf = htobe32 (size); // length buf += 4; compressor.Get (buf, size); + memset (buf + 4, 0, 4); // source and destination ports. TODO: fill with proper values later buf[9] = 6; // streaming protocol msg->len += size + 4; FillI2NPMessageHeader (msg, eI2NPData);