From ac6f3564c9af080af8d80dd01404909234ecd051 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 26 Apr 2013 16:58:57 +0300 Subject: Moved message 'escaping' to AtmospherePushConnection to be able to send pre-escaped messages (#11635) Change-Id: I732bb26cfea9c5f59d85d6119d19a61e73381f5b --- .../com/vaadin/server/communication/AtmospherePushConnection.java | 6 +++--- server/src/com/vaadin/server/communication/PushHandler.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'server') 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: -- cgit v1.2.3