From: Matti Tahvonen Date: Tue, 18 Jan 2011 14:22:24 +0000 (+0000) Subject: opening the server side for customized communication ( e.g. jsonp) X-Git-Tag: 6.7.0.beta1~486 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eb61bfbe9bd113a8a23b60e5a896a0b7d9872ed3;p=vaadin-framework.git opening the server side for customized communication ( e.g. jsonp) svn changeset:16931/svn branch:6.5 --- diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 40469cdef8..d30c0920f3 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1169,10 +1169,9 @@ public abstract class AbstractCommunicationManager implements Callback callback, Application application2, Window window) throws IOException, InvalidUIDLSecurityKeyException { boolean success = true; - int contentLength = request.getContentLength(); - if (contentLength > 0) { - String changes = readRequest(request); + String changes = getRequestPayload(request); + if (changes != null) { // Manage bursts one by one final String[] bursts = changes.split(VAR_BURST_SEPARATOR); @@ -1350,9 +1349,12 @@ public abstract class AbstractCommunicationManager implements * @return * @throws IOException */ - private static String readRequest(Request request) throws IOException { + protected String getRequestPayload(Request request) throws IOException { int requestLength = request.getContentLength(); + if (requestLength == 0) { + return null; + } byte[] buffer = new byte[requestLength]; InputStream inputStream = request.getInputStream();