Re-instantiate the lzo compresses test for zpaq compression.

This commit is contained in:
Con Kolivas 2012-03-16 23:20:54 +11:00
parent 8b680e72ac
commit 77f6965f25

View file

@ -177,8 +177,11 @@ static int lzo_compresses(rzip_control *control, uchar *s_buf, i64 s_len);
static int zpaq_compress_buf(rzip_control *control, struct compress_thread *cthread, long thread) static int zpaq_compress_buf(rzip_control *control, struct compress_thread *cthread, long thread)
{ {
i64 c_len = 0;
uchar *c_buf; uchar *c_buf;
i64 c_len;
if (!lzo_compresses(control, cthread->s_buf, cthread->s_len))
return 0;
c_buf = malloc(cthread->s_len + control->page_size); c_buf = malloc(cthread->s_len + control->page_size);
if (!c_buf) { if (!c_buf) {
@ -186,6 +189,8 @@ static int zpaq_compress_buf(rzip_control *control, struct compress_thread *cthr
return -1; return -1;
} }
c_len = 0;
zpaq_compress(c_buf, &c_len, cthread->s_buf, cthread->s_len, control->compression_level / 4 + 1); zpaq_compress(c_buf, &c_len, cthread->s_buf, cthread->s_len, control->compression_level / 4 + 1);
if (unlikely(c_len >= cthread->c_len)) { if (unlikely(c_len >= cthread->c_len)) {