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/08/23 17:51:33 UTC
svn commit: r1160753 - in /nutch/branches/branch-1.4: CHANGES.txt
src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpResponse.java
Author: jnioche
Date: Tue Aug 23 15:51:32 2011
New Revision: 1160753
URL: http://svn.apache.org/viewvc?rev=1160753&view=rev
Log:
NUTCH-1089 short compressed pages caused Exception
Modified:
nutch/branches/branch-1.4/CHANGES.txt
nutch/branches/branch-1.4/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpResponse.java
Modified: nutch/branches/branch-1.4/CHANGES.txt
URL: http://svn.apache.org/viewvc/nutch/branches/branch-1.4/CHANGES.txt?rev=1160753&r1=1160752&r2=1160753&view=diff
==============================================================================
--- nutch/branches/branch-1.4/CHANGES.txt (original)
+++ nutch/branches/branch-1.4/CHANGES.txt Tue Aug 23 15:51:32 2011
@@ -2,6 +2,8 @@ Nutch Change Log
Release 1.4 - Current development
+* NUTCH-1089 Short compressed pages caused exception in protocol-httpclient (Simone Frenzel via jnioche)
+
* NUTCH-1085 Nutch script does not require HADOOP_HOME (jnioche)
* NUTCH-1075 Delegate language identification to Tika (jnioche)
Modified: nutch/branches/branch-1.4/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpResponse.java
URL: http://svn.apache.org/viewvc/nutch/branches/branch-1.4/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpResponse.java?rev=1160753&r1=1160752&r2=1160753&view=diff
==============================================================================
--- nutch/branches/branch-1.4/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpResponse.java (original)
+++ nutch/branches/branch-1.4/src/plugin/protocol-httpclient/src/java/org/apache/nutch/protocol/httpclient/HttpResponse.java Tue Aug 23 15:51:32 2011
@@ -124,7 +124,7 @@ public class HttpResponse implements Res
int totalRead = 0;
ByteArrayOutputStream out = new ByteArrayOutputStream();
while ((bufferFilled = in.read(buffer, 0, buffer.length)) != -1
- && totalRead + bufferFilled < contentLength) {
+ && totalRead + bufferFilled <= contentLength) {
totalRead += bufferFilled;
out.write(buffer, 0, bufferFilled);
}