Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Unified Diff: sync/tools/testserver/xmppserver.py

Issue 15580002: Make use of InvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/tools/sync_listen_notifications.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/tools/testserver/xmppserver.py
diff --git a/sync/tools/testserver/xmppserver.py b/sync/tools/testserver/xmppserver.py
index 0b32933c52a0065d1a1f351b19fa4d728b9fcd1f..3f7c7d05a769bf652401e6f611a5079b7a0905eb 100644
--- a/sync/tools/testserver/xmppserver.py
+++ b/sync/tools/testserver/xmppserver.py
@@ -575,6 +575,14 @@ class XmppServer(asyncore.dispatcher):
def SetAuthenticated(self, auth_valid):
self._authenticated = auth_valid
+ # We check authentication only when establishing new connections. We close
+ # all existing connections here to make sure previously connected clients
+ # pick up on the change. It's a hack, but it works well enough for our
+ # purposes.
+ if not self._authenticated:
+ for connection in self._handshake_done_connections:
+ connection.close()
+
def GetAuthenticated(self):
return self._authenticated
« no previous file with comments | « sync/tools/sync_listen_notifications.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698