mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-20 13:24:09 -07:00
Fix LZ4 warning.
This commit is contained in:
parent
ba158d8dc6
commit
7612bf3302
5 changed files with 99 additions and 25 deletions
|
@ -125,7 +125,7 @@ bool Packet::compress()
|
|||
unsigned char buf[ZT_PROTO_MAX_PACKET_LENGTH * 2];
|
||||
if ((!compressed())&&(size() > (ZT_PACKET_IDX_PAYLOAD + 32))) {
|
||||
int pl = (int)(size() - ZT_PACKET_IDX_PAYLOAD);
|
||||
int cl = LZ4_compress((const char *)field(ZT_PACKET_IDX_PAYLOAD,(unsigned int)pl),(char *)buf,pl);
|
||||
int cl = LZ4_compress_default((const char *)field(ZT_PACKET_IDX_PAYLOAD,(unsigned int)pl),(char *)buf,pl,ZT_PROTO_MAX_PACKET_LENGTH * 2);
|
||||
if ((cl > 0)&&(cl < pl)) {
|
||||
(*this)[ZT_PACKET_IDX_VERB] |= (char)ZT_PROTO_VERB_FLAG_COMPRESSED;
|
||||
setSize((unsigned int)cl + ZT_PACKET_IDX_PAYLOAD);
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
#include "Utils.hpp"
|
||||
#include "Buffer.hpp"
|
||||
|
||||
#ifdef ZT_USE_SYSTEM_LZ4
|
||||
#include <lz4.h>
|
||||
#else
|
||||
//#ifdef ZT_USE_SYSTEM_LZ4
|
||||
//#include <lz4.h>
|
||||
//#else
|
||||
#include "../ext/lz4/lz4.h"
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
/**
|
||||
* Protocol version -- incremented only for major changes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue