[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [bridgedb/develop] Prefer to use information from NS rather than descriptor
commit bafeaaa06f5a0f70b922b93f3d14baa2e6ff33fe
Author: Matthew Finkel <Matthew.Finkel@xxxxxxxxx>
Date: Fri Jan 31 18:12:48 2014 +0000
Prefer to use information from NS rather than descriptor
---
lib/bridgedb/Bridges.py | 14 ++++++++++----
lib/bridgedb/Main.py | 5 +++--
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py
index 6bf4b2e..c8ecc9f 100644
--- a/lib/bridgedb/Bridges.py
+++ b/lib/bridgedb/Bridges.py
@@ -540,6 +540,7 @@ def parseStatusFile(networkstatusFile):
logging.debug(" ORAddress: {0}".format(ORaddr))
logging.debug(" ORport: {0}".format(ORport))
logging.debug(" dirport: {0}".format(dirport))
+ descDigest = toHex(descDigest)
elif ID and line.startswith("a "):
try:
@@ -556,10 +557,15 @@ def parseStatusFile(networkstatusFile):
elif ID and timestamp and line.startswith("s "):
running, stable = networkstatus.parseSLine(line)
- logging.debug("Bridges.parseStatusFile(): "\
- "yielding %s running=%s stable=%s oraddrs=%s ts=%s"
- % (toHex(ID), running, stable, or_addresses, timestamp))
- yield ID, running, stable, or_addresses, timestamp
+ logging.debug("Bridges.parseStatusFile(): "
+ "yielding %s nickname=%s descDigest=%s "
+ "running=%s stable=%s oraddr=%s orport=%s "
+ "oraddrs=%s ts=%s"
+ % (toHex(ID), nickname, descDigest, running,
+ stable, ORaddr, ORport, or_addresses,
+ timestamp))
+ yield (ID, nickname, descDigest, running, stable, ORaddr, ORport,
+ or_addresses, timestamp)
(nickname, ID, descDigest, timestamp, ORaddr, ORport, dirport,
addr, portlist) = (None for x in xrange(9))
diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py
index 4ab4d02..c3a90ea 100644
--- a/lib/bridgedb/Main.py
+++ b/lib/bridgedb/Main.py
@@ -98,8 +98,9 @@ def load(state, splitter, clear=False):
logging.info("Opening network status file: %s" % state.STATUS_FILE)
f = open(state.STATUS_FILE, 'r')
- for (ID, running, stable,
- or_addresses, timestamp) in Bridges.parseStatusFile(f):
+ for (ID, nickname, descDigest, running, stable,
+ ORaddr, ORport, or_addresses,
+ timestamp) in Bridges.parseStatusFile(f):
status[ID] = running, stable
addresses[ID] = or_addresses
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits