[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #6131 [Torflow]: bwauths learn to recognize Capped=1 in consensus line and treat it differently
#6131: bwauths learn to recognize Capped=1 in consensus line and treat it
differently
---------------------+------------------------------------------------------
Reporter: arma | Owner: aagbsn
Type: task | Status: needs_revision
Priority: normal | Milestone:
Component: Torflow | Version:
Keywords: | Parent: #2286
Points: | Actualpoints:
---------------------+------------------------------------------------------
Comment(by aagbsn):
2. Whoops, good catch.
1. Hmm.
{{{
aagbsn@debian:~/code/torflow/TorCtl$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> nsline = "w Bandwidth=100 Unmeasured=1"
>>> m = re.search(r"^w Bandwidth=(\d+)(?:\s(Unmeasured)=1)?", nsline,
re.M)
>>> m.groups()
('100', 'Unmeasured')
>>> nsline = "w Bandwidth=100"
>>> m = re.search(r"^w Bandwidth=(\d+)(?:\s(Unmeasured)=1)?", nsline,
re.M)
>>> m.groups()
('100', None)
>>> nsline = "w Bandwidth=100 Unmeasured=0"
>>> m = re.search(r"^w Bandwidth=(\d+)(?:\s(Unmeasured)=1)?", nsline,
re.M)
>>> m.groups()
('100', None)
>>>
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6131#comment:10>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs