summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2011-02-10 13:30:29 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2011-02-10 13:30:29 +0000
commitb5d7536b473abf61ade51193ebf3f6e53258da8a (patch)
tree980b7ddc56d70ca6bafd74d739758adb45d52319 /src
parent12c4e52e0014063b797381fc6022d8f305349c4e (diff)
downloadvaadin-framework-b5d7536b473abf61ade51193ebf3f6e53258da8a.tar.gz
vaadin-framework-b5d7536b473abf61ade51193ebf3f6e53258da8a.zip
modified multipartinputstream so that it is not that much dependent on the one and only function where it is used. Also modified tests to work somewhat sane and removed some invalid tests.
svn changeset:17278/svn branch:6.5
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index acbd44ddd3..4cad1cc8e6 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -85,6 +85,8 @@ import com.vaadin.ui.Window;
public abstract class AbstractCommunicationManager implements
Paintable.RepaintRequestListener, Serializable {
+ private static final String DASHDASH = "--";
+
private static final Logger logger = Logger
.getLogger(AbstractCommunicationManager.class.getName());
@@ -382,8 +384,6 @@ public abstract class AbstractCommunicationManager implements
Response response, StreamVariable streamVariable,
String variableName, VariableOwner owner, String boundary)
throws IOException {
- boundary = CRLF + "--" + boundary + "--";
-
// multipart parsing, supports only one file for request, but that is
// fine for our current terminal
@@ -417,7 +417,8 @@ public abstract class AbstractCommunicationManager implements
}
}
- contentLength -= (boundary.length() + 2); // 2 == CRLF
+ contentLength -= (boundary.length() + CRLF.length() + 2
+ * DASHDASH.length() + 2); // 2 == CRLF
/*
* Reads bytes from the underlying stream. Compares the read bytes to
@@ -2199,7 +2200,8 @@ public abstract class AbstractCommunicationManager implements
public SimpleMultiPartInputStream(InputStream realInputStream,
String boundaryString) {
- boundary = boundaryString.toCharArray();
+ boundary = (CRLF + DASHDASH + boundaryString + DASHDASH)
+ .toCharArray();
this.realInputStream = realInputStream;
}