Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I've added ipfilter.dat support to Bitflu::Network #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

d5ve
Copy link

@d5ve d5ve commented Dec 2, 2012

Hi Adrian,

As discussed on #14 I have ipfilter.dat support to Bitflu::Network

I added a new config option "ipfilter_dat_file" which is to hold the filename of any filter file.

If the config option is set, Bitflu::Network->new() now checks to see if Net::IPAddress::Filter::IPFilterDat is installed, and that the filter file exists.

Then init() instantiates a filter, and loads the rules from the filter file into it.

Then there is a new method IpIsFiltered() which is checked every place that IpIsBlacklisted() currently is.

I've run this changed version of bitflu.pl and performed a bunch of downloads successfully. I also tested that any IP addresses which were blocked were in my filter file.

I'm more than happy to perform any clean-ups you think are necessary to the code. I tried to match the existing style as much as possible.

Cheers,

Dave

d5ve added 3 commits November 29, 2012 21:40
TODO: Needs to instantiate the filter.
Now checks for perl module and filter file in constructor, but loads the
actual filter in init().

Now calls debug() for every IP filtered.

Plus copy and paste bugfix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant