Skip to content

Commit

Permalink
make LZO mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
voipmonitor committed Aug 25, 2015
1 parent d9f99af commit 0142f6e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
8 changes: 0 additions & 8 deletions tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2781,11 +2781,7 @@ FileZipHandler::eTypeCompress FileZipHandler::convTypeCompress(const char *typeC
} else if(!strcmp(_compress_method, "snappy")) {
return(FileZipHandler::snappy);
} else if(!strcmp(_compress_method, "lzo")) {
#ifdef HAVE_LIBLZO
return(FileZipHandler::lzo);
#else
return(FileZipHandler::gzip);
#endif //HAVE_LIBLZO
}
return(FileZipHandler::compress_na);
}
Expand Down Expand Up @@ -2824,11 +2820,7 @@ void FileZipHandler::setTypeCompressDefault() {
break;
case pcap_rtp:
case graph_rtp:
#ifdef HAVE_LIBLZO
typeCompress = lzo;
#else
typeCompress = gzip;
#endif //HAVE_LIBLZO
break;
default:
typeCompress = gzip;
Expand Down
18 changes: 0 additions & 18 deletions tools_dynamic_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,9 @@ CompressStream::CompressStream(eTypeCompress typeCompress, u_int32_t compressBuf
this->lz4Stream = NULL;
this->lz4StreamDecode = NULL;
#endif //HAVE_LIBLZ4
#ifdef HAVE_LIBLZO
this->lzoWrkmem = NULL;
this->lzoWrkmemDecompress = NULL;
this->lzoDecompressData = NULL;
#endif //HAVE_LIBLZO
this->snappyDecompressData = NULL;
this->zipLevel = Z_DEFAULT_COMPRESSION;
this->lzmaLevel = 6;
Expand Down Expand Up @@ -162,12 +160,10 @@ void CompressStream::initCompress() {
}
break;
case lzo:
#ifdef HAVE_LIBLZO
if(!this->lzoWrkmem) {
this->lzoWrkmem = new FILE_LINE u_char[LZO1X_1_MEM_COMPRESS];
createCompressBuffer();
}
#endif //HAVE_LIBLZO
break;
case lz4:
if(!this->compressBuffer) {
Expand Down Expand Up @@ -233,15 +229,13 @@ void CompressStream::initDecompress(u_int32_t dataLen) {
createDecompressBuffer(dataLen);
break;
case lzo:
#ifdef HAVE_LIBLZO
if(!this->lzoWrkmemDecompress) {
this->lzoWrkmemDecompress = new FILE_LINE u_char[LZO1X_1_MEM_COMPRESS];
}
if(!this->lzoDecompressData && this->forceStream) {
this->lzoDecompressData = new FILE_LINE SimpleBuffer();
}
createDecompressBuffer(dataLen);
#endif //HAVE_LIBLZO
break;
case lz4:
createDecompressBuffer(dataLen);
Expand Down Expand Up @@ -272,12 +266,10 @@ void CompressStream::termCompress() {
this->lzmaStream = NULL;
}
#endif //ifdef HAVE_LIBLZMA
#ifdef HAVE_LIBLZO
if(this->lzoWrkmem) {
delete [] this->lzoWrkmem;
this->lzoWrkmem = NULL;
}
#endif //ifdef HAVE_LIBLZO
#ifdef HAVE_LIBLZ4
if(this->lz4Stream) {
LZ4_freeStream(this->lz4Stream);
Expand Down Expand Up @@ -307,7 +299,6 @@ void CompressStream::termDecompress() {
delete this->snappyDecompressData;
this->snappyDecompressData = NULL;
}
#ifdef HAVE_LIBLZO
if(this->lzoDecompressData) {
delete this->lzoDecompressData;
this->lzoDecompressData = NULL;
Expand All @@ -316,7 +307,6 @@ void CompressStream::termDecompress() {
delete [] this->lzoWrkmemDecompress;
this->lzoWrkmemDecompress = NULL;
}
#endif //HAVE_LIBLZO
#ifdef HAVE_LIBLZ4
if(this->lz4StreamDecode) {
LZ4_freeStreamDecode(this->lz4StreamDecode);
Expand Down Expand Up @@ -446,7 +436,6 @@ bool CompressStream::compress(char *data, u_int32_t len, bool flush, CompressStr
}
break;
case lzo: {
#ifdef HAVE_LIBLZO
if(!this->compressBuffer) {
this->initCompress();
}
Expand Down Expand Up @@ -490,7 +479,6 @@ bool CompressStream::compress(char *data, u_int32_t len, bool flush, CompressStr
}
chunk_offset += chunk_len;
}
#endif //HAVE_LIBLZO
}
break;
case lz4: {
Expand Down Expand Up @@ -687,7 +675,6 @@ bool CompressStream::decompress(char *data, u_int32_t len, u_int32_t decompress_
}
break;
case lzo: {
#ifdef HAVE_LIBLZO
if(this->forceStream) {
this->initDecompress(0);
this->lzoDecompressData->add(data, len);
Expand Down Expand Up @@ -731,7 +718,6 @@ bool CompressStream::decompress(char *data, u_int32_t len, u_int32_t decompress_
break;
}
}
#endif //HAVE_LIBLZO
}
break;
case lz4:
Expand Down Expand Up @@ -886,11 +872,9 @@ CompressStream::eTypeCompress CompressStream::convTypeCompress(const char *typeC
else if(!strcmp(_compress_method, "snappy")) {
return(CompressStream::snappy);
}
#ifdef HAVE_LIBLZO
else if(!strcmp(_compress_method, "lzo")) {
return(CompressStream::lzo);
}
#endif //HAVE_LIBLZO
#ifdef HAVE_LIBLZ4
else if(!strcmp(_compress_method, "lz4")) {
return(CompressStream::lz4);
Expand All @@ -911,10 +895,8 @@ const char *CompressStream::convTypeCompress(eTypeCompress typeCompress) {
#endif //HAVE_LIBLZMA
case snappy:
return("snappy");
#ifdef HAVE_LIBLZO
case lzo:
return("lzo");
#endif //HAVE_LIBLZO
#ifdef HAVE_LIBLZ4
case lz4:
return("lz4");
Expand Down

0 comments on commit 0142f6e

Please sign in to comment.