You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2012/02/07 13:14:07 UTC

svn commit: r1241438 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityDecoder.java

Author: olegk
Date: Tue Feb  7 12:14:07 2012
New Revision: 1241438

URL: http://svn.apache.org/viewvc?rev=1241438&view=rev
Log:
minor optimization in IdentityDecoder

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

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityDecoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityDecoder.java?rev=1241438&r1=1241437&r2=1241438&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityDecoder.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/IdentityDecoder.java Tue Feb  7 12:14:07 2012
@@ -117,8 +117,8 @@ public class IdentityDecoder extends Abs
                             " > " + dst.size() + "]");
                 }
                 bytesRead = dst.transferFrom(this.channel, position, count);
-                if (bytesRead == 0) {
-                    bytesRead = buffer.fill(this.channel);
+                if (count > 0 && bytesRead == 0) {
+                    bytesRead = this.buffer.fill(this.channel);
                 }
             } else {
                 bytesRead = -1;