Skip to content
GitLab
  • Explore
  • Sign in
  • Legacy
  • TracTrac
  • Issues
  • #8162

Parsing AddrMapEvent fails because attribute is not always quoted

The AddrMapEvent class expects that "expiry" is a QUOTED argument, but according to the spec it is either quoted or the value NEVER:

  Syntax:
     "650" SP "ADDRMAP" SP Address SP NewAddress SP Expiry
       [SP "error=" ErrorCode] [SP "EXPIRES=" UTCExpiry] CRLF

     NewAddress = Address / "<error>"
     Expiry = DQUOTE ISOTime DQUOTE / "NEVER"

     ErrorCode = "yes" / "internal" / "Unable to launch resolve request"
     UTCExpiry = DQUOTE IsoTime DQUOTE

Tor seems to return the value NEVER when the result is already in the DNS cache because of a query made by another control connection.

desoxy@localhost:~/git/stem$ ./example.py ; ./example.py 
Exception in thread Event Notifier:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "./stem/stem/control.py", line 602, in _event_loop
    self._handle_event(event_message)
  File "./stem/stem/control.py", line 2004, in _handle_event
    stem.response.convert("EVENT", event_message, arrived_at = time.time())
  File "./stem/stem/response/__init__.py", line 117, in convert
    message._parse_message(**kwargs)
  File "./stem/stem/response/events.py", line 55, in _parse_message
    self._parse_standard_attr()
  File "./stem/stem/response/events.py", line 100, in _parse_standard_attr
    raise stem.ProtocolError("The %s value should be quoted, but didn't have a starting quote: %s" % (attr_name, self))
ProtocolError: The expiry value should be quoted, but didn't have a starting quote: ADDRMAP heise.de 193.99.144.80 NEVER 

Trac:
Username: Desoxy

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking