From 534d62075f8c03cc3e77f301e53be53acdefd1c9 Mon Sep 17 00:00:00 2001 From: Mark Thomas Date: Sun, 8 Feb 2015 16:52:39 +0000 Subject: [PATCH] Follow-up to r1657908 Always reset pos to zero before next request. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc8.0.x/trunk@1658208 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/coyote/http11/AbstractInputBuffer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/org/apache/coyote/http11/AbstractInputBuffer.java b/java/org/apache/coyote/http11/AbstractInputBuffer.java index 19ff044cb..beef7fdfc 100644 --- a/java/org/apache/coyote/http11/AbstractInputBuffer.java +++ b/java/org/apache/coyote/http11/AbstractInputBuffer.java @@ -291,9 +291,10 @@ public void nextRequest() { // Copy leftover bytes to the beginning of the buffer if (lastValid - pos > 0 && pos > 0) { System.arraycopy(buf, pos, buf, 0, lastValid - pos); - lastValid = lastValid - pos; - pos = 0; } + // Always reset pos to zero + lastValid = lastValid - pos; + pos = 0; // Recycle filters for (int i = 0; i <= lastActiveFilter; i++) {