From 5a6bd7b522472135dd64103e0d6b328eccc072af Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Mon, 17 Jan 2011 10:26:09 +0000 Subject: [PATCH] fixes #6295. Multipart parser didn't survive properly from a specific bytes (DOS line break at the end of the file). svn changeset:16905/svn branch:6.5 --- .../gwt/server/AbstractCommunicationManager.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 38794da948..3fd9538fbc 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -498,10 +498,20 @@ public abstract class AbstractCommunicationManager implements } else { b = charArray[curBoundaryIndex++]; if (curBoundaryIndex == matchedCount) { - matchedCount = 0; curBoundaryIndex = 0; - // next call for getBuffered will return the - // bufferedByte, not from the char array. + if (bufferedByte != charArray[0]) { + // next call for getBuffered will return the + // bufferedByte, not from the char array. + matchedCount = 0; + } else { + /* + * Special case where buffered byte again matches + * the boundaryString. Step over one byte matching + * the boundary. + */ + matchedCount = 1; + bufferedByte = -1; + } } } if (b == -1) { -- 2.39.5