]> source.dussan.org Git - vaadin-framework.git/commitdiff
opening the server side for customized communication ( e.g. jsonp)
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 18 Jan 2011 14:22:24 +0000 (14:22 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 18 Jan 2011 14:22:24 +0000 (14:22 +0000)
svn changeset:16931/svn branch:6.5

src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java

index 40469cdef827582874577429f0c8ac7b8a2f698e..d30c0920f3e858cb50cbce9e02733e6585b4a454 100644 (file)
@@ -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();