This project is archived. Its data is read-only.
BridgeDB should use Stem for parsing descriptors
Currently we're lenient about how we parse descriptors, in some cases. For example, if we only need the first four values on a line, but the spec mandates there be 6 we presently do: ``` if len(items) >= 4: nickname = items[1] ip = items[2].strip('[]') orport = int(items[3]) ``` We should ensure the line is well-formed before accepting the values. Something closer to: ``` if len(items) == 6: nickname = item[1] ip = items[2].strip('[]') orport = int(items[3]) else: logging.warn("Parsed malformed descriptor 'router' line. Expected 6 items, but line has %d" % len(items)) logging.debug(" Line: %s" % items) ``` (Logging sold separately. (Untested code))
issue