You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by jn...@apache.org on 2011/09/01 17:14:53 UTC
svn commit: r1164107 - in /nutch/trunk: CHANGES.txt
src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java
Author: jnioche
Date: Thu Sep 1 15:14:53 2011
New Revision: 1164107
URL: http://svn.apache.org/viewvc?rev=1164107&view=rev
Log:
NUTCH-1096 Empty (not null) ContentLength results in failure of fetch (Ferdy Galema via jnioche)
Modified:
nutch/trunk/CHANGES.txt
nutch/trunk/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java
Modified: nutch/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/nutch/trunk/CHANGES.txt?rev=1164107&r1=1164106&r2=1164107&view=diff
==============================================================================
--- nutch/trunk/CHANGES.txt (original)
+++ nutch/trunk/CHANGES.txt Thu Sep 1 15:14:53 2011
@@ -2,6 +2,8 @@ Nutch Change Log
Release 2.0 - Current Development
+* NUTCH-1096 Empty (not null) ContentLength results in failure of fetch (Ferdy Galema via jnioche)
+
* NUTCH-1089 Short compressed pages caused exception in protocol-httpclient (Simone Frenzel via jnioche)
* NUTCH-1085 Nutch script does not require HADOOP_HOME (jnioche)
Modified: nutch/trunk/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java
URL: http://svn.apache.org/viewvc/nutch/trunk/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java?rev=1164107&r1=1164106&r2=1164107&view=diff
==============================================================================
--- nutch/trunk/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java (original)
+++ nutch/trunk/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java Thu Sep 1 15:14:53 2011
@@ -211,7 +211,8 @@ public class HttpResponse implements Res
if (contentLengthString != null) {
contentLengthString = contentLengthString.trim();
try {
- contentLength = Integer.parseInt(contentLengthString);
+ if (!contentLengthString.isEmpty())
+ contentLength = Integer.parseInt(contentLengthString);
} catch (NumberFormatException e) {
throw new HttpException("bad content length: "+contentLengthString);
}