[or-cvs] r16667: {weather} Fix the URLbase to use SSL. People shouldn't be using the in (weather/trunk)

ioerror at seul.org ioerror at seul.org
Wed Aug 27 00:48:17 UTC 2008


Author: ioerror
Date: 2008-08-26 20:48:17 -0400 (Tue, 26 Aug 2008)
New Revision: 16667

Modified:
   weather/trunk/config.py
   weather/trunk/poll.py
Log:
Fix the URLbase to use SSL. People shouldn't be using the internet without SSL.

In addition, I believe that I've found the root cause of the website portion of the code breaking. Specifically, it appears that we have nodes in out database that fail the following:

     string = "ns/id/" + node_id
     info = self.control.get_info(string)

I'm not entirely certain /why/ this fails but I suspect the node itself may not be valid anymore. By catching this as an exception, Tor Weather at least _runs_ again. I'm able to do a walk through of a node signup and confirm it.

This patch may have seriously broken the actual internal functionality of Tor Weather but I do not believe this is the case.

We're down to a single exception with running weather:

    Traceback (most recent call last):
      File "/var/www/tor-weather/poll.py", line 166, in ping
          assert self.tp.ping(node)
          AssertionError



Modified: weather/trunk/config.py
===================================================================
--- weather/trunk/config.py	2008-08-26 23:36:34 UTC (rev 16666)
+++ weather/trunk/config.py	2008-08-27 00:48:17 UTC (rev 16667)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python2.5
 
-URLbase = "http://weather.torproject.org"
+URLbase = "https://weather.torproject.org"
 
 weather_storage = "/var/lib/torweather/"
 

Modified: weather/trunk/poll.py
===================================================================
--- weather/trunk/poll.py	2008-08-26 23:36:34 UTC (rev 16666)
+++ weather/trunk/poll.py	2008-08-27 00:48:17 UTC (rev 16667)
@@ -48,7 +48,11 @@
   def ping(self, node_id):
     "Let's see if this tor node is up."
     string = "ns/id/" + node_id
-    info = self.control.get_info(string)
+    try:
+       info = self.control.get_info(string)
+    except:
+        info = None
+        return False
     # info looks like this:
     # {'ns/id/FFCB46DB1339DA84674C70D7CB586434C4370441': 'r moria1 /8tG2xM52oRnTHDXy1hkNMQ3BEE pavoLDqxMvw+T1VHR5hmmgpr9self 2007-10-10 21:12:08 128.31.0.34 9001 9031\ns Authority Fast Named Running Valid V2Dir\n'}
     ip,port = info[string].split()[6:8]



More information about the tor-commits mailing list