Fix FastCGI encoding (really really)

This commit is contained in:
2021-05-04 23:14:35 +02:00
parent 52ea541833
commit ff708230bd

View File

@ -396,16 +396,16 @@ int fastcgi_send(fastcgi_conn *conn, sock *client, int flags) {
z_stream gz_state; z_stream gz_state;
BrotliEncoderState *br_state = NULL; BrotliEncoderState *br_state = NULL;
if (flags & FASTCGI_COMPRESS_BR) { if (flags & FASTCGI_COMPRESS_BR) {
flags &= !FASTCGI_COMPRESS_GZ; flags &= ~FASTCGI_COMPRESS_GZ;
if (brotli_init(&br_state) != 0) { if (brotli_init(&br_state) != 0) {
print(ERR_STR "Unable to init brotli: %s" CLR_STR, strerror(errno)); print(ERR_STR "Unable to init brotli: %s" CLR_STR, strerror(errno));
flags &= !FASTCGI_COMPRESS_BR; flags &= ~FASTCGI_COMPRESS_BR;
} }
} else if (flags & FASTCGI_COMPRESS_GZ) { } else if (flags & FASTCGI_COMPRESS_GZ) {
flags &= !FASTCGI_COMPRESS_BR; flags &= ~FASTCGI_COMPRESS_BR;
if (gzip_init(&gz_state) != 0) { if (gzip_init(&gz_state) != 0) {
print(ERR_STR "Unable to init gzip: %s" CLR_STR, strerror(errno)); print(ERR_STR "Unable to init gzip: %s" CLR_STR, strerror(errno));
flags &= !FASTCGI_COMPRESS_GZ; flags &= ~FASTCGI_COMPRESS_GZ;
} }
} }