I would think the best thing to do would add an extra column in the session table to do a hash of the "host" column, so you know when it changes that you need to re-check the IP.
Then add another (bool) column to store if it's an open proxy or not.
Find a hook in the session management to add in the necessary check / storing code, and you should be good to go.
Then each time a page is requested all it has to do is a quick MD5 of the current IP against the stored IP, if it's the same and it's okay, then nothing new, if it changes then make a new RBL request and go from there.
Session is a HEAP table, so it will go fast, and also clear out over time.
I could knock this out in an afternoon (assuming there are hooks in place, otherwise it would require a couple lines of manual file editing).
Easy as pie.
|