Re: [PATCH] Make remote_host available in hook_pre_connection

2009-01-13 Thread Matt Sergeant
On Tue, 13 Jan 2009 08:38:09 -0600, David Nicol wrote: > On Mon, Jan 12, 2009 at 5:11 PM, Matt Sergeant wrote: >> Except doesn't work with -async. Well, it works, but blocks. > > a deferred approach would help async, as the job to look up the remote > name could get spawned at pre-connection time

Re: [PATCH] Make remote_host available in hook_pre_connection

2009-01-13 Thread David Nicol
On Mon, Jan 12, 2009 at 5:11 PM, Matt Sergeant wrote: > Except doesn't work with -async. Well, it works, but blocks. a deferred approach would help async, as the job to look up the remote name could get spawned at pre-connection time and it wouldn't have to block until it was needed, which might

Re: [PATCH] Make remote_host available in hook_pre_connection

2009-01-12 Thread Matt Sergeant
On Mon, 12 Jan 2009, Jared Johnson wrote: 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. Except do

Re: [PATCH] Make remote_host available in hook_pre_connection

2009-01-12 Thread David Nicol
On Mon, Jan 12, 2009 at 10:39 AM, Jared Johnson wrote: > Was the name 'remote_hostname' as > opposed to 'remote_host' intentional? no. I wrote that without looking at any references at all. > As an aside, I don't really > understand why pre-connection hooks need the same information they could

Re: [PATCH] Make remote_host available in hook_pre_connection

2009-01-12 Thread Jared Johnson
David Nicol wrote: On Mon, Jan 12, 2009 at 10:19 AM, Jared Johnson 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

Re: [PATCH] Make remote_host available in hook_pre_connection

2009-01-12 Thread Jared Johnson
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 tha

Re: [PATCH] Make remote_host available in hook_pre_connection

2009-01-12 Thread David Nicol
On Mon, Jan 12, 2009 at 9:52 AM, Jared Johnson wrote: > Robert Spier wrote: >> >> What's the point of this? If you need the hostname in the pre-connect >> hook you can look it up there from the IP address which you already >> have. > > If you need to look up the hostname on every incoming connect

Re: [PATCH] Make remote_host available in hook_pre_connection

2009-01-12 Thread Jared Johnson
Robert Spier wrote: What's the point of this? If you need the hostname in the pre-connect hook you can look it up there from the IP address which you already have. If you need to look up the hostname on every incoming connection, it doesn't seem sensible to do so yourself in a plugin, and the

Re: [PATCH] Make remote_host available in hook_pre_connection

2009-01-10 Thread Robert Spier
What's the point of this? If you need the hostname in the pre-connect hook you can look it up there from the IP address which you already have. Also, what about async? -R Jared Johnson wrote: > > Just one more... > > I've found it useful to have remote_host available in my pre-conection >