diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-04-12 11:09:02 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2013-04-12 11:09:02 +0300 |
commit | 3ce5d9eaada2392d111b74d2427ff242ed61a348 (patch) | |
tree | 5d9be2bdeed0f330b6b4ee29b46cbeea3578c0fd | |
parent | 2cb32194f623c45cf5e8eed47ccf69a372eda813 (diff) | |
download | vaadin-framework-3ce5d9eaada2392d111b74d2427ff242ed61a348.tar.gz vaadin-framework-3ce5d9eaada2392d111b74d2427ff242ed61a348.zip |
Make AtmosphereResource field transient (#11512)
Also add assert to catch theoretical case when old push connection is
still active even though session has been deserialized
Change-Id: I5b11a4ef273e36e90d97bfa84bf7e90bc2395fd7
-rw-r--r-- | server/src/com/vaadin/server/communication/AtmospherePushConnection.java | 2 | ||||
-rw-r--r-- | server/src/com/vaadin/server/communication/PushHandler.java | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java index 8b146e3d50..0bd3dc5a14 100644 --- a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java +++ b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java @@ -37,7 +37,7 @@ public class AtmospherePushConnection implements Serializable, PushConnection { private UI ui; private boolean pending = true; - private AtmosphereResource resource; + private transient AtmosphereResource resource; public AtmospherePushConnection(UI ui) { this.ui = ui; diff --git a/server/src/com/vaadin/server/communication/PushHandler.java b/server/src/com/vaadin/server/communication/PushHandler.java index 146671e3a6..b2994d547f 100644 --- a/server/src/com/vaadin/server/communication/PushHandler.java +++ b/server/src/com/vaadin/server/communication/PushHandler.java @@ -109,6 +109,12 @@ public class PushHandler implements AtmosphereHandler { connection.connect(resource); } else if (req.getMethod().equalsIgnoreCase("POST")) { + assert connection.isConnected() : "Got push from the client " + + "even though the connection does not seem to be " + + "open. This might happen if a HttpSession is " + + "serialized and deserialized while the push " + + "connection is kept open."; + /* * We received a UIDL request through Atmosphere. If the push * channel is bidirectional (websockets), the request was sent |