Skip to content

Commit

Permalink
recode for close zlib compressor;
Browse files Browse the repository at this point in the history
  • Loading branch information
housisong committed Dec 10, 2023
1 parent c060abb commit 42e6c45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compress_plugin_demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ int _default_setParallelThreadNumber(hdiff_TCompress* compressPlugin,int threadN
return _zlib_compress_open_at(compressPlugin,compressLevel,compressMemLevel,out_code,
(_zlib_TCompress*)self_at,_mem_buf_end-self_at);
}
static int _zlib_compress_close_by(const hdiff_TCompress* compressPlugin,_zlib_TCompress* self){
int result=1;//true;
static hpatch_BOOL _zlib_compress_close_by(const hdiff_TCompress* compressPlugin,_zlib_TCompress* self){
hpatch_BOOL result=hpatch_TRUE;
if (!self) return result;
if (self->c_stream.state!=0){
int ret=deflateEnd(&self->c_stream);
result=(Z_OK==ret);
result=(Z_OK==ret)|(Z_DATA_ERROR==ret);
}
memset(self,0,sizeof(_zlib_TCompress));
return result;
Expand Down

0 comments on commit 42e6c45

Please sign in to comment.