summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-04-11 13:33:20 +0300
committerLeif Åstrand <leif@vaadin.com>2013-04-11 13:33:20 +0300
commita01b40ec889337a97e9a3273d996cb0bbd40524c (patch)
treed4f14d0d112e3734bfa5ee0877cc8a5aa2955538 /server
parent6959b1f8b6bf2ba8ee39bb555ae7c9f0007d1d71 (diff)
downloadvaadin-framework-a01b40ec889337a97e9a3273d996cb0bbd40524c.tar.gz
vaadin-framework-a01b40ec889337a97e9a3273d996cb0bbd40524c.zip
Use longer padding for streaming requests to avoid IE8 issues (#11573)
Change-Id: Ib9fd7634065719146a492318916a4f7a1527e2a0
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/server/communication/PushHandler.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/src/com/vaadin/server/communication/PushHandler.java b/server/src/com/vaadin/server/communication/PushHandler.java
index 75deb6d7e7..146671e3a6 100644
--- a/server/src/com/vaadin/server/communication/PushHandler.java
+++ b/server/src/com/vaadin/server/communication/PushHandler.java
@@ -18,12 +18,14 @@ package com.vaadin.server.communication;
import java.io.IOException;
import java.io.Writer;
+import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.atmosphere.cpr.AtmosphereHandler;
import org.atmosphere.cpr.AtmosphereRequest;
import org.atmosphere.cpr.AtmosphereResource;
+import org.atmosphere.cpr.AtmosphereResource.TRANSPORT;
import org.atmosphere.cpr.AtmosphereResourceEvent;
import org.json.JSONException;
@@ -43,6 +45,13 @@ import com.vaadin.ui.UI;
*/
public class PushHandler implements AtmosphereHandler {
+ private static final String LONG_PADDING;
+ static {
+ char[] array = new char[4096];
+ Arrays.fill(array, '-');
+ LONG_PADDING = String.copyValueOf(array);
+
+ }
private VaadinServletService service;
public PushHandler(VaadinServletService service) {
@@ -91,6 +100,11 @@ public class PushHandler implements AtmosphereHandler {
resource.transport());
resource.getResponse().setContentType(
"application/json; charset=UTF-8");
+ if (resource.transport() == TRANSPORT.STREAMING) {
+ // IE8 requires a longer padding to work properly if the
+ // initial message is small (#11573)
+ resource.padding(LONG_PADDING);
+ }
resource.suspend();
connection.connect(resource);