From c4bf3249bc4d59576161db08c7d7f4b7de6ce2be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gra=C3=B1a?= Date: Tue, 27 Aug 2013 11:09:55 -0300 Subject: [PATCH] Treat responses without content-length or Transfer-Encoding as good responses There is not a way to determine if responses without Content-Length or Transfer-Encoding are complete, this change treat them as good responses but flags them as "partial". This is backout change only for this functionality of 3c64a989 --- scrapy/core/downloader/handlers/http11.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scrapy/core/downloader/handlers/http11.py b/scrapy/core/downloader/handlers/http11.py index 28666185a..4fe5bb9be 100644 --- a/scrapy/core/downloader/handlers/http11.py +++ b/scrapy/core/downloader/handlers/http11.py @@ -148,5 +148,7 @@ class _ResponseReader(protocol.Protocol): body = self._bodybuf.getvalue() if reason.check(ResponseDone): self._finished.callback((self._txresponse, body, None)) + elif reason.check(PotentialDataLoss): + self._finished.callback((self._txresponse, body, ['partial'])) else: self._finished.errback(reason)