ソースを参照

Ensure refresh message is sent on invalid CSRF (#17042)

If we create an AtmospherePushConnection and a broadcaster like before we would
need to suspend the connection to ensure the AtmosphereResource is actually
added to the broadcaster

Change-Id: I7265ac0594b7a4da2c7a49fa34ebfbb27e1abdff
tags/7.4.2
Artur Signell 9年前
コミット
f3fb1b7147
1個のファイルの変更3行の追加17行の削除
  1. 3
    17
      server/src/com/vaadin/server/communication/PushHandler.java

+ 3
- 17
server/src/com/vaadin/server/communication/PushHandler.java ファイルの表示

@@ -470,23 +470,9 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter {
*/
private static void sendRefreshAndDisconnect(AtmosphereResource resource)
throws IOException {
if (resource instanceof AtmosphereResourceImpl
&& !((AtmosphereResourceImpl) resource).isInScope()) {
// The resource is no longer valid so we should not write
// anything to it
getLogger()
.fine("sendRefreshAndDisconnect called for resource no longer in scope");
return;
}

AtmospherePushConnection connection = new AtmospherePushConnection(null);
connection.connect(resource);
try {
connection.sendMessage(VaadinService
.createCriticalNotificationJSON(null, null, null, null));
} finally {
connection.disconnect();
}
sendNotificationAndDisconnect(resource,
VaadinService.createCriticalNotificationJSON(null, null, null,
null));
}

/**

読み込み中…
キャンセル
保存