mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-24 01:46:36 +02:00
set minimum comression level
This commit is contained in:
parent
34d2ae4500
commit
dd679c261c
1 changed files with 2 additions and 0 deletions
|
@ -404,6 +404,7 @@ namespace stream
|
||||||
{
|
{
|
||||||
I2NPMessage * msg = NewI2NPMessage ();
|
I2NPMessage * msg = NewI2NPMessage ();
|
||||||
CryptoPP::Gzip compressor;
|
CryptoPP::Gzip compressor;
|
||||||
|
compressor.SetDeflateLevel (CryptoPP::Gzip::MIN_DEFLATE_LEVEL);
|
||||||
compressor.Put (payload, len);
|
compressor.Put (payload, len);
|
||||||
compressor.MessageEnd();
|
compressor.MessageEnd();
|
||||||
int size = compressor.MaxRetrievable ();
|
int size = compressor.MaxRetrievable ();
|
||||||
|
@ -411,6 +412,7 @@ namespace stream
|
||||||
*(uint32_t *)buf = htobe32 (size); // length
|
*(uint32_t *)buf = htobe32 (size); // length
|
||||||
buf += 4;
|
buf += 4;
|
||||||
compressor.Get (buf, size);
|
compressor.Get (buf, size);
|
||||||
|
memset (buf + 4, 0, 4); // source and destination ports. TODO: fill with proper values later
|
||||||
buf[9] = 6; // streaming protocol
|
buf[9] = 6; // streaming protocol
|
||||||
msg->len += size + 4;
|
msg->len += size + 4;
|
||||||
FillI2NPMessageHeader (msg, eI2NPData);
|
FillI2NPMessageHeader (msg, eI2NPData);
|
||||||
|
|
Loading…
Add table
Reference in a new issue