Changeset 931

Show
Ignore:
Timestamp:
06/08/06 21:24:20
Author:
miyagawa
Message:

add dns cache to Rule::URLBL

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Rule/Deduped.pm

    r929 r931  
    6767=item path 
    6868 
    69 Specified path to the database. This config is dependent for the DB_File backend. 
     69Specified path to the database. This config is dependent for the 
     70DB_File backend. 
    7071 
    7172=item compare_body 
  • trunk/plagger/lib/Plagger/Rule/URLBL.pm

    r711 r931  
    2727    return unless $url; 
    2828 
     29    if (exists $self->{dnscache}->{$url}) { 
     30        return $self->{dnscache}->{$url}; 
     31    } 
     32 
    2933    my $res = Net::DNS::Resolver->new; 
    3034    my $dnsbl = $self->{dnsbl}; 
     
    4044        if ($q && $q->answer) { 
    4145            Plagger->context->log(info => "$domain.$dns found."); 
    42             return 0; 
     46            return $self->{dnscache}->{$url} = 0; 
    4347        } 
    4448    } 
    45     return 1; 
     49 
     50    return $self->{dnscache}->{$url} = 1; 
    4651} 
    4752