Re: Apache2::Connection::remote_ip

Dr James Smith <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On 20/11/2014 22:39, John Dunlap wrote:
> Could you give us a link to the documentation you are using?
>
> On Thu, Nov 20, 2014 at 5:38 PM, worik <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Can't locate object method "remote_ip" via package
>     "Apache2::Connection
>
You are probably looking at 2.2 documentation for a 2.4 Apache...

I tend to use:
     ($r->connection->can('remote_ip') ? $r->connection->remote_ip : 
$r->connection->client_ip );

(In fact have a wrapper function to do this)

so the code base will (does) work on 2.2 & 2.4...

james
>
>     Turns out I should have used  $r->useragent_ip
>
>     What is going on?  Why is the documentation at odds with the code?
>
>     W
>     --
>     Why is the legal status of chardonnay different to that of cannabis?
>     [email protected] <mailto:[email protected]>
>     021-1680650, (03) 4821804
>                               Aotearoa (New Zealand)
>                                  I voted for love
>
>
>
>
> -- 
> John Dunlap
> /CTO | Lariat/
> /
> /
> /*Direct:*/
> /[email protected] <mailto:[email protected]>/
> /
> *Customer Service:*/
> 877.268.6667
> [email protected] <mailto:[email protected]>



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com



-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.