David Nicol wrote:
On Mon, Jan 12, 2009 at 10:19 AM, Jared Johnson <jar...@nmgi.com> wrote:
Does too.  Looking up a hostname can take time, which will be wasted
if you turn out not to care.  And duplicate lookups will be cached.
You know, you have a good point there.  I recently reverted some custom work
I did on the RBL plugin that tried to cache positive results; it didn't seem
that necessary as DNS can do that for us anyway.  I hadn't thought of this
in the same way.  I don't think this patch could be considered for inclusion

I meant "I don't think this patch should be considered for inclusion"

:)

-Jared

I propose something like the following in the connection package

   sub remote_hostname{
       my $self = shift;
       $self->{_remote_hostname} ||= Net::DNS::get_name($self->{_remote_ip})
   }

This seems reasonable to me on principal. Was the name 'remote_hostname' as opposed to 'remote_host' intentional? As an aside, I don't really understand why pre-connection hooks need the same information they could get from $connection methods (like remote ip and remote host) passed to them in the argument hash?

As David pointed out, it does seem that DNS caching itself makes it somewhat trivial whether or not QP attempts to cache results of DNS queries.

-Jared

Reply via email to