Index: lib/transfer.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/transfer.c,v
retrieving revision 1.318
diff -u -r1.318 transfer.c
--- lib/transfer.c	25 Oct 2006 20:40:15 -0000	1.318
+++ lib/transfer.c	19 Nov 2006 22:38:11 -0000
@@ -501,9 +501,15 @@
                   k->keepon |= KEEP_WRITE;
                 }
               }
-              else
+              else {
                 k->header = FALSE; /* no more header to parse! */
 
+                if((k->size == -1) && !conn->bits.chunk)
+                  /* no Content-Length nor Content-Encoding chunked have been
+                     received, there is no body in this response */
+                  stop_reading = TRUE;
+              }
+
               if (417 == k->httpcode) {
                 /*
                  * we got: "417 Expectation Failed" this means:
