From: fhanik Date: Fri, 13 Apr 2007 18:08:43 +0000 (+0000) Subject: Use the remaining for the byte buffer as the capacity is the total capacity and not... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=6a3893cece4eafbfef9c49dfe85e40ea09a8f277;p=tomcat7.0 Use the remaining for the byte buffer as the capacity is the total capacity and not the limit git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@528570 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/coyote/http11/InternalNioOutputBuffer.java b/java/org/apache/coyote/http11/InternalNioOutputBuffer.java index c4f4d29a1..e54d2d279 100644 --- a/java/org/apache/coyote/http11/InternalNioOutputBuffer.java +++ b/java/org/apache/coyote/http11/InternalNioOutputBuffer.java @@ -788,8 +788,8 @@ public class InternalNioOutputBuffer if (socket.getBufHandler().getWriteBuffer().position() == socket.getBufHandler().getWriteBuffer().capacity()) { flushBuffer(); } - if (thisTime > socket.getBufHandler().getWriteBuffer().capacity() - socket.getBufHandler().getWriteBuffer().position()) { - thisTime = socket.getBufHandler().getWriteBuffer().capacity() - socket.getBufHandler().getWriteBuffer().position(); + if (thisTime > socket.getBufHandler().getWriteBuffer().remaining()) { + thisTime = socket.getBufHandler().getWriteBuffer().remaining(); } addToBB(b,start,thisTime); len = len - thisTime;