vastly improvee the speed of the access_processor's main process method

by returning dict's instead of lists from IPTools. This turns a very
nasty O(n)*3 into O(1)*3 .. much nicer. All tests pass.
This commit is contained in:
Stef T 2012-09-26 23:38:18 +02:00
parent bdb59f54ec
commit 9ce73e2e1e
1 changed files with 3 additions and 2 deletions

View File

@ -24,8 +24,9 @@ try:
CIDR_support = True
def return_ips(conf, conf_tag):
return IpRangeList(*[x.strip() for x in
conf.get(conf_tag, '').split(',') if x.strip()])
return dict((k, 1) for k in
IpRangeList(*[x.strip() for x in
conf.get(conf_tag, '').split(',') if x.strip()]))
def sanitize_ips(line_data):
for x in ['lb_ip', 'client_ip', 'log_source']:
if line_data[x] == '-':