Skip to content
Browse files

rendezvous/client.py: Remove useless privacy check

This commit removes a useless privacy check because now the
rendezvous client does not event attempt to contact the server
unless privacy settings are OK.  So there's no point in doing
the same check again just before running the test.

Note that this is the right behavior: I don't want a client
without the right settings to even attempt to communicate with
our master server.

Tested setting manually invalid privacy settings and then
trying a debug-mode rendezvous from the command line.
  • Loading branch information...
1 parent 7ce2f51 commit 238d9950b400c8799da8b8285d108ffa7b0e89ef @bassosimone bassosimone committed Jan 11, 2012
Showing with 23 additions and 30 deletions.
  1. +23 −30 neubot/rendezvous/client.py
View
53 neubot/rendezvous/client.py
@@ -174,37 +174,30 @@ def got_response(self, stream, request, response):
self._schedule()
else:
- if (CONFIG["privacy.informed"] and
- not CONFIG["privacy.can_collect"]):
- LOG.warning("cannot run test without permission "
- "to save the results")
- self._schedule()
- else:
+ conf = self.conf.copy()
+
+ #
+ # Subscribe _before_ connecting. This way we
+ # immediately see "testdone" if the connection fails
+ # and we can _schedule the next attempt.
+ #
+ NOTIFIER.subscribe("testdone", lambda *a, **kw: \
+ self._schedule())
+
+ if test == "speedtest":
+ conf["speedtest.client.uri"] = m1.available[
+ "speedtest"][0]
+ client = ClientSpeedtest(POLLER)
+ client.configure(conf)
+ client.connect_uri()
+
+ elif test == "bittorrent":
+ conf["bittorrent._uri"] = m1.available[
+ "bittorrent"][0]
+ bittorrent.run(POLLER, conf)
- conf = self.conf.copy()
-
- #
- # Subscribe _before_ connecting. This way we
- # immediately see "testdone" if the connection fails
- # and we can _schedule the next attempt.
- #
- NOTIFIER.subscribe("testdone", lambda *a, **kw: \
- self._schedule())
-
- if test == "speedtest":
- conf["speedtest.client.uri"] = m1.available[
- "speedtest"][0]
- client = ClientSpeedtest(POLLER)
- client.configure(conf)
- client.connect_uri()
-
- elif test == "bittorrent":
- conf["bittorrent._uri"] = m1.available[
- "bittorrent"][0]
- bittorrent.run(POLLER, conf)
-
- else:
- NOTIFIER.publish("testdone")
+ else:
+ NOTIFIER.publish("testdone")
def _schedule(self):

0 comments on commit 238d995

Please sign in to comment.
Something went wrong with that request. Please try again.