Skip to content

Commit

Permalink
switch to lz4a
Browse files Browse the repository at this point in the history
  • Loading branch information
wjo1212 committed Jan 16, 2019
1 parent 06e5e45 commit 907bf44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aliyun/log/logclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import lz4

def lz_decompress(raw_size, data):
return lz4.decompress(struct.pack('<I', raw_size) + data)
return lz4.loads(struct.pack('<I', raw_size) + data)

def lz_compresss(data):
return lz4.dumps(data)[4:]
Expand Down Expand Up @@ -379,7 +379,7 @@ def put_logs(self, request):
if is_compress:
if lz4:
headers['x-log-compresstype'] = 'lz4'
compress_data = lz4.compress(body)
compress_data = lz_compresss(body)
else:
headers['x-log-compresstype'] = 'deflate'
compress_data = zlib.compress(body)
Expand Down

0 comments on commit 907bf44

Please sign in to comment.