The event parsing in TorCtl makes heavy use of regexes which is both unpleasant for readability and problematic when there's newly introduced attributes. The vast majority of events use a simple positional/keyword pattern so we can abstract much of this into something a little nicer.
This is a good change that will make adding new events (e.g. STATUS_CLIENT) easier in the future. I am using this event parsing model in testing with my client and it works as well as the old model. (It feels faster to me, also, but I have no numbers to back that up.)
2 of my BwAuthority scanners halted progress over the weekend. I am not sure how or if this is related, other than that these changes were merged for testing a day or so prior.
2 of my BwAuthority scanners halted progress over the weekend. I am not sure how or if this is related, other than that these changes were merged for testing a day or so prior.
I restarted, and another scanner has frozen already. This looks like similar behavior to #3834 (moved), where the scanner freezes without warning. I have opened another ticket to track this issue here: #4015 (moved)
Ugh. Is there something in this paring code that could be throwing uncaught exceptions and/or quietly exiting? I see some new exceptions can be thrown from a few commits..
For CIRC events the path is a positional argument. For instance...
650 CIRC 9 EXTENDED $59A3237FA7EB42CAD215FB6EA638ABF7F245873Ezzz,$E5E3E9A472EAF7BE9682B86E92305DB4C71048EFAmunet2 PURPOSE=GENERAL
Which is parsed from the _decodeFields function:
1494 for entry in body.split():1495 m = KW_ARG.match(entry)1496 1497 if m:1498 k, v = m.groups()1499 keywords[k] = v1500 else:1501 positional.append(entry)
Due to the split there shouldn't be any extra whitespace around the positional entries.
Are you sure that this is a bug? Are you able to reproduce any use case where the strip is needed?
For CIRC events the path is a positional argument. For instance...
650 CIRC 9 EXTENDED $59A3237FA7EB42CAD215FB6EA638ABF7F245873Ezzz,$E5E3E9A472EAF7BE9682B86E92305DB4C71048EFAmunet2 PURPOSE=GENERAL
Which is parsed from the _decodeFields function:
{{{
1494 for entry in body.split():
1495 m = KW_ARG.match(entry)
1496
1497 if m:
1498 k, v = m.groups()
1499 keywords[k] = v
1500 else:
1501 positional.append(entry)
}}}
Due to the split there shouldn't be any extra whitespace around the positional entries.
Are you sure that this is a bug? Are you able to reproduce any use case where the strip is needed?
You're right, I'm wrong. And my fix does not resolve BwAuthority issues. :-( Sorry.
I informed Mike via IRC, and I'm mentioning it here too: I plan to merge #2411 (moved) some time in December, barring misadventure -- so it's probably a good idea to get this stuff straightened out on about that timeframe.