Apache Nutch is an extensible and scalable web crawler
(NUTCH-1919) Getting timeout when server returns Content-Length: 0
Julien Nioched75572730668
diff --git a/CHANGES.txt b/CHANGES.txtindex 2bc8504ec..e714d905c 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -2,6 +2,8 @@ Nutch Change LogNutch Current Development 1.10-SNAPSHOT+* NUTCH-1919 Getting timeout when server returns Content-Length: 0 (jnioche)+* NUTCH-1912 Dump tool -mimetype parameter needs to be optional to prevent NPE (Tyler Palsulich via lewismc)* NUTCH-1881 ant target resolve-default to keep test libs (snagel)diff --git a/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java b/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.javaindex 27032f4d8..5bb5aec4d 100644--- a/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java+++ b/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java@@ -288,6 +288,13 @@ public class HttpResponse implements Response {ByteArrayOutputStream out = new ByteArrayOutputStream(Http.BUFFER_SIZE);byte[] bytes = new byte[Http.BUFFER_SIZE];int length = 0;++ // do not try to read if the contentLength is 0+ if (contentLength == 0){+ content = new byte[0];+ return;+ }+// read contentint i = in.read(bytes);while (i != -1) {