From cff36fe76c06899e43c8953c87c1232678ba1c3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Tue, 21 Jul 2009 22:11:30 +0000 Subject: [PATCH] * if we fail to compress, don't add gzip header and logwarn + backtrace --- webcit/tcp_sockets.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) -- 2.30.2