hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r515680 - /jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java
Date Wed, 07 Mar 2007 18:24:44 GMT
Author: olegk
Date: Wed Mar  7 10:24:44 2007
New Revision: 515680

URL: http://svn.apache.org/viewvc?view=rev&rev=515680
Log:
Fixed problem with incorrect handling of the end of stream condition

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java?view=diff&rev=515680&r1=515679&r2=515680
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/impl/nio/codecs/LengthDelimitedDecoder.java
Wed Mar  7 10:24:44 2007
@@ -78,6 +78,10 @@
                 bytesRead = this.channel.read(dst);
             }
         }
+        if (bytesRead == -1) {
+            this.completed = true;
+            return -1;
+        }
         this.len += bytesRead;
         if (this.len >= this.contentLength) {
             this.completed = true;



Mime
View raw message