diff options
author | Artur Signell <artur@vaadin.com> | 2013-04-26 16:58:57 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-04-26 15:45:05 +0000 |
commit | ac6f3564c9af080af8d80dd01404909234ecd051 (patch) | |
tree | ae0055cca5b9429cd91bbf8ef3b91b9aacbc8971 /server | |
parent | 8127219e09ffc722e1e2c6ca3f2f5940d581d52f (diff) | |
download | vaadin-framework-ac6f3564c9af080af8d80dd01404909234ecd051.tar.gz vaadin-framework-ac6f3564c9af080af8d80dd01404909234ecd051.zip |
Moved message 'escaping' to AtmospherePushConnection to be able to send pre-escaped messages (#11635)
Change-Id: I732bb26cfea9c5f59d85d6119d19a61e73381f5b
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/communication/AtmospherePushConnection.java | 6 | ||||
-rw-r--r-- | server/src/com/vaadin/server/communication/PushHandler.java | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java index f33a10c572..bb1461b18e 100644 --- a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java +++ b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java @@ -74,17 +74,17 @@ public class AtmospherePushConnection implements Serializable, PushConnection { } catch (JSONException e) { throw new IOException("Error writing UIDL", e); } - // "Broadcast" the changes to the single client only - sendMessage(writer.toString()); + sendMessage("for(;;);[{" + writer.toString() + "}]"); } /** - * Sends the given message to the current client + * Sends the given message to the current client. * * @param message * The message to send */ void sendMessage(String message) { + // "Broadcast" the changes to the single client only lastMessage = getResource().getBroadcaster().broadcast(message, getResource()); } diff --git a/server/src/com/vaadin/server/communication/PushHandler.java b/server/src/com/vaadin/server/communication/PushHandler.java index 1277fe88c5..387608a140 100644 --- a/server/src/com/vaadin/server/communication/PushHandler.java +++ b/server/src/com/vaadin/server/communication/PushHandler.java @@ -325,7 +325,7 @@ public class PushHandler implements AtmosphereHandler { getLogger().log(Level.FINER, "Writing message to resource {0}", id); Writer writer = resource.getResponse().getWriter(); - writer.write("for(;;);[{" + event.getMessage() + "}]"); + writer.write(event.getMessage().toString()); switch (resource.transport()) { case SSE: |