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

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

Issue 797253003: Make Python sync server stoppable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/tools/testserver/sync_testserver.py
diff --git a/sync/tools/testserver/sync_testserver.py b/sync/tools/testserver/sync_testserver.py
index b3ca64203043cac0040294efc69ebd98b3f917d3..73ce93f5e11ca8c2d8335c0881248f8483ee4f64 100755
--- a/sync/tools/testserver/sync_testserver.py
+++ b/sync/tools/testserver/sync_testserver.py
@@ -27,13 +27,13 @@ import xmppserver
class SyncHTTPServer(testserver_base.ClientRestrictingServerMixIn,
maniscalco 2015/01/06 18:39:59 What's the overall goal of this change? Does the
sigbjorn 2015/01/07 09:26:34 This allows for clean shutdown of the server. On L
testserver_base.BrokenPipeHandlerMixIn,
- testserver_base.StoppableHTTPServer):
+ BaseHTTPServer.HTTPServer):
"""An HTTP server that handles sync commands."""
def __init__(self, server_address, xmpp_port, request_handler_class):
- testserver_base.StoppableHTTPServer.__init__(self,
- server_address,
- request_handler_class)
+ BaseHTTPServer.HTTPServer.__init__(self,
+ server_address,
+ request_handler_class)
self._sync_handler = chromiumsync.TestServer()
self._xmpp_socket_map = {}
self._xmpp_server = xmppserver.XmppServer(
@@ -92,7 +92,8 @@ class SyncHTTPServer(testserver_base.ClientRestrictingServerMixIn,
except:
xmpp_connection.handle_error()
- while True:
+ self.stop = False
pval...(no longer on Chromium) 2015/01/05 17:49:01 when/where can this be set to True?
sigbjorn 2015/01/06 08:11:27 This would be set to True from the calling thread.
maniscalco 2015/01/06 18:39:59 Maybe I'm missing something, why not create a Stop
sigbjorn 2015/01/07 09:26:34 The reason is compatibility. This is what Stoppabl
+ while not self.stop:
read_fds = [ self.fileno() ]
write_fds = []
exceptional_fds = []
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698