From 0b363eb2457df73bf48b8842db35f5832a130705 Mon Sep 17 00:00:00 2001
From: Witold Filipczyk <witekfl@poczta.onet.pl>
Date: Sun, 17 Feb 2008 12:39:33 +0100
Subject: [PATCH] content encoding: handle the case when the len is 0 in the
 chunked encoding.

We do not want to start decompression when the len is 0
with the chunked encoding.
---
 src/protocol/http/http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/protocol/http/http.c b/src/protocol/http/http.c
index ab27239d1..69ce67096 100644
--- a/src/protocol/http/http.c
+++ b/src/protocol/http/http.c
@@ -1034,7 +1034,7 @@ decompress_data(struct connection *conn, unsigned char *data, int len,
 			/* ... we aren't finishing yet. */
 			int written = safe_write(conn->stream_pipes[1], data, len);
 
-			if (written > 0) {
+			if (written >= 0) {
 				data += written;
 				len -= written;