From: Wilfried Göesgens Date: Tue, 21 Jul 2009 22:11:30 +0000 (+0000) Subject: * if we fail to compress, don't add gzip header and logwarn + backtrace X-Git-Tag: v7.86~966 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=cff36fe76c06899e43c8953c87c1232678ba1c3d * if we fail to compress, don't add gzip header and logwarn + backtrace --- diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index 15a1c1c69..02515306b 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -602,9 +602,14 @@ long end_burst(void) fd_set wset; int fdflags; - if (!DisableGzip && (WCC->Hdr->HR.gzip_ok) && CompressBuffer(WCC->WBuf)) + if (!DisableGzip && (WCC->Hdr->HR.gzip_ok)) { - hprintf("Content-encoding: gzip\r\n"); + if (CompressBuffer(WCC->WBuf) > 0) + hprintf("Content-encoding: gzip\r\n"); + else { + lprintf(CTDL_ALERT, "Compression failed: %d [%s] sending uncompressed\n", errno, strerror(errno)); + wc_backtrace(); + } } if (WCC->Hdr->HR.prohibit_caching)