Author: violetagg Date: Wed Oct 5 15:57:05 2016 New Revision: 1763462 URL: http://svn.apache.org/viewvc?rev=1763462&view=rev Log: Use ByteBuffer.mark() to mark the position.
Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java?rev=1763462&r1=1763461&r2=1763462&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/Http11InputBuffer.java Wed Oct 5 15:57:05 2016 @@ -731,13 +731,13 @@ public class Http11InputBuffer implement byteBuffer.limit(end).position(end); } - int oldPosition = byteBuffer.position(); + byteBuffer.mark(); if (byteBuffer.position() < byteBuffer.limit()) { byteBuffer.position(byteBuffer.limit()); } byteBuffer.limit(byteBuffer.capacity()); int nRead = wrapper.read(block, byteBuffer); - byteBuffer.limit(byteBuffer.position()).position(oldPosition); + byteBuffer.limit(byteBuffer.position()).reset(); if (nRead > 0) { return true; } else if (nRead == -1) { @@ -1090,6 +1090,7 @@ public class Http11InputBuffer implement ByteBuffer temp = ByteBuffer.allocate(size); temp.put(byteBuffer); byteBuffer = temp; + byteBuffer.mark(); temp = null; } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org