Fix compression
This commit is contained in:
@ -155,14 +155,14 @@ int cache_process() {
|
||||
compress_compress_mode(&comp_ctx, COMPRESS_GZ,buf + read - avail_in, &avail_in,
|
||||
comp_buf, &avail_out, feof(file));
|
||||
fwrite(comp_buf, 1, CACHE_BUF_SIZE - avail_out, comp_file_gz);
|
||||
} while (avail_in != 0);
|
||||
} while (avail_in != 0 || avail_out != CACHE_BUF_SIZE);
|
||||
avail_in = read;
|
||||
do {
|
||||
avail_out = CACHE_BUF_SIZE;
|
||||
compress_compress_mode(&comp_ctx, COMPRESS_BR, buf + read - avail_in, &avail_in,
|
||||
comp_buf, &avail_out, feof(file));
|
||||
fwrite(comp_buf, 1, CACHE_BUF_SIZE - avail_out, comp_file_br);
|
||||
} while (avail_in != 0);
|
||||
} while (avail_in != 0 || avail_out != CACHE_BUF_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -487,7 +487,7 @@ int fastcgi_send(fastcgi_conn *conn, sock *client, int flags) {
|
||||
sock_send(client, ptr, buf_len, 0);
|
||||
if (flags & FASTCGI_CHUNKED) sock_send(client, "\r\n", 2, 0);
|
||||
}
|
||||
} while ((flags & FASTCGI_COMPRESS) && avail_in != 0);
|
||||
} while ((flags & FASTCGI_COMPRESS) && (avail_in != 0 || avail_out != sizeof(comp_out)));
|
||||
if (finish_comp) goto finish;
|
||||
} else {
|
||||
print(ERR_STR "Unknown FastCGI type: %i" CLR_STR, header.type);
|
||||
|
Reference in New Issue
Block a user