I've added ipfilter.dat support to Bitflu::Network#15
Open
d5ve wants to merge 3 commits intoadrian-bl:masterfrom
Open
I've added ipfilter.dat support to Bitflu::Network#15d5ve wants to merge 3 commits intoadrian-bl:masterfrom
d5ve wants to merge 3 commits intoadrian-bl:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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