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);
       }


Reply via email to