Author: jnioche Date: Thu Sep 1 15:15:33 2011 New Revision: 1164108 URL: http://svn.apache.org/viewvc?rev=1164108&view=rev Log: NUTCH-1096 Empty (not null) ContentLength results in failure of fetch (Ferdy Galema via jnioche)
Modified: nutch/branches/branch-1.4/CHANGES.txt nutch/branches/branch-1.4/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java Modified: nutch/branches/branch-1.4/CHANGES.txt URL: http://svn.apache.org/viewvc/nutch/branches/branch-1.4/CHANGES.txt?rev=1164108&r1=1164107&r2=1164108&view=diff ============================================================================== --- nutch/branches/branch-1.4/CHANGES.txt (original) +++ nutch/branches/branch-1.4/CHANGES.txt Thu Sep 1 15:15:33 2011 @@ -2,6 +2,8 @@ Nutch Change Log Release 1.4 - Current development +* NUTCH-1096 Empty (not null) ContentLength results in failure of fetch (Ferdy Galema via jnioche) + * NUTCH-1073 Rename parameters 'fetcher.threads.per.host.by.ip' and 'fetcher.threads.per.host' (jnioche) * NUTCH-1089 Short compressed pages caused exception in protocol-httpclient (Simone Frenzel via jnioche) Modified: nutch/branches/branch-1.4/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java URL: http://svn.apache.org/viewvc/nutch/branches/branch-1.4/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java?rev=1164108&r1=1164107&r2=1164108&view=diff ============================================================================== --- nutch/branches/branch-1.4/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java (original) +++ nutch/branches/branch-1.4/src/plugin/protocol-http/src/java/org/apache/nutch/protocol/http/HttpResponse.java Thu Sep 1 15:15:33 2011 @@ -213,7 +213,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); }