You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Radoslaw Zielinski <ra...@gmail.com> on 2006/07/18 14:30:32 UTC

ap_get_remote_logname in PerlProcessConnectionHandler

Hello,

I'm developing a mp2 module implementing functionality of the spamd
daemon from the SpamAssassin project.  It has its own (HTTP-like)
protocol, so I'm using PerlProcessConnectionHandler.

I need to check user's ident (RFC 1413) and compare it with the User
header.  Net::Ident proved to be utterly useless and I don't feel like
writing my own implementation...  But, luckily, APR seems to have the
ap_get_remote_logname() function, interfaced to mod_perl and enabled
by Apache2::Access ($r->get_remote_logname()).

Can I access this functionality in PerlProcessConnectionHandler (and
maybe PerlPreConnectionHandler) somehow?  How to get to $r?

Would be best if I could start the ident request in PreConnHandler and
retrieve result when I need it (while reading the headers).

Second thing: can I specify custom timeout for it somehow?

-- 
Radosław Zieliński <ra...@pld-linux.org>

Re: ap_get_remote_logname in PerlProcessConnectionHandler

Posted by Radoslaw Zielinski <ra...@pld-linux.org>.
Philip M. Gollucci <pg...@p6m7g8.com> [20-07-2006 23:28]:
>> writing my own implementation...  But, luckily, APR seems to have the
>> ap_get_remote_logname() function, interfaced to mod_perl and enabled
>> by Apache2::Access ($r->get_remote_logname()).

Correcting, if someone follows: it's not APR, but mod_ident, separated
from core in 2.1.

>> Can I access this functionality in PerlProcessConnectionHandler (and
>> maybe PerlPreConnectionHandler) somehow?  How to get to $r?
> http://perl.apache.org/docs/2.0/user/handlers/protocols.html#PerlPreConnectionHandler
> my $r = Apache2::RequestRec->new($c);

Thanks; I've figured that out eventually, but it took me a while.

>> Second thing: can I specify custom timeout for it somehow?
> http://perl.apache.org/docs/2.0/api/Apache2/ServerRec.html#C_timeout_

I've just used the IdentityCheckTimeout directive.


BTW, IMHO it should be an Apache2::Connection method -- ident is a
connection-specific thing rather than request.

-- 
Radosław Zieliński <ra...@pld-linux.org>

Re: ap_get_remote_logname in PerlProcessConnectionHandler

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
> writing my own implementation...  But, luckily, APR seems to have the
> ap_get_remote_logname() function, interfaced to mod_perl and enabled
> by Apache2::Access ($r->get_remote_logname()).
> 
> Can I access this functionality in PerlProcessConnectionHandler (and
> maybe PerlPreConnectionHandler) somehow?  How to get to $r?
http://perl.apache.org/docs/2.0/user/handlers/protocols.html#PerlPreConnectionHandler
my $r = Apache2::RequestRec->new($c);

> Second thing: can I specify custom timeout for it somehow?
http://perl.apache.org/docs/2.0/api/Apache2/ServerRec.html#C_timeout_

HTH

-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."