Closed (outdated)
Project:
Drupal core
Version:
6.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Feb 2011 at 16:47 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
catchSubscribe. It'd be worth adding this as a merge request to Pressflow as well.
Comment #2
c960657 commentedNote that the query does not make good use of MySQL's query cache, because the client's IP address is different for each client. So even though this is just one query per request, it is a query that is often not cached in the database.
Comment #3
c960657 commentedTagging.
Comment #4
c960657 commentedRerolled with Git.
Comment #5
rjbrown99 commentedQuestion about #4. It seems to check for a variable blocked_ips, and then does the access check against that array. The variables are all called blocked_ips, but the original function checks for three different $type possibilities: host, mail, or user.
It would seem that you could still potentially accomplish that with an array, but the variable names are a bit misleading. Perhaps renaming to blocked_access or something similar, with examples for each different $type.
Comment #6
c960657 commentedYou are right. The intention was only to support the "host" option with the blocked_ips array (like in D7), because _drupal_bootstrap() calls
drupal_is_denied('host', ip_address())every request.Here is an updated patch that checks that $type == "host".
Comment #7
rjbrown99 commentedThanks, question though: you COULD pop host, mail, or user into that same array couldn't you? For example, in my case I'm not using this at all so I'd rather just pass in an empty array for all of it, or manually maintain my array in the conf file if needed.
Comment #8
c960657 commentedYes, that would be possible, though the performance improvement for the other two would be smaller, because the function is not invoked with those $type in every request. I think adding support for those two also would be a bit more than just a backport of the D7 feature.
Comment #9
rjbrown99 commentedAaah, I now understand why you are only doing 'host' and not the others. RTFC - bootstrap.inc (from Pressflow below, probably the same or similar):
The drupal_is_denied call is only made with 'host', so the enclosed patch only really needs to account for that to obtain the speed improvement.
Just posting back in case someone else finds this thread.