You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by worik <wo...@gmail.com> on 2014/11/20 23:38:30 UTC

Apache2::Connection::remote_ip

Can't locate object method "remote_ip" via package "Apache2::Connection

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?
       worik.stanton@gmail.com 021-1680650, (03) 4821804
                          Aotearoa (New Zealand)
                             I voted for love

Re: Apache2::Connection::remote_ip

Posted by Randolf Richardson <ra...@modperl.pl>.
> 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 <worik.stanton@gmail.com 
> > <ma...@gmail.com>> 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 );

	So, what's the general attitude about backward compatibility?  I 
rely on $r->connection->remote_ip and although I can update my code 
quite easily (although I have many modules that will need updating) I 
now have to use a conditional if I want to use the same code across 
two different Apache 2 HTTPd server versions?  I'm not keen about 
this, especially if it's going to mean I'm going to have to do this 
with other subroutines as well.

	Why not leave "remote_ip" in place, and just document the preferred 
"client_ip" subroutine as "future direction," then switch over to it 
when Apache 3 (and presumably ModPerl 3) comes onto the scene?

	Major changes from ModPerl 1 to ModPerl 2 were understandable, but 
removing (even if due to renaming) within the same version is 
something that seems questionable to me, partly because it will break 
existing code.

[End of reply.]

> (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?
> >     worik.stanton@gmail.com <ma...@gmail.com>
> >     021-1680650, (03) 4821804
> >                               Aotearoa (New Zealand)
> >                                  I voted for love
> >
> >
> >
> >
> > -- 
> > John Dunlap
> > /CTO | Lariat/
> > /
> > /
> > /*Direct:*/
> > /john@lariat.co <ma...@lariat.co>/
> > /
> > *Customer Service:*/
> > 877.268.6667
> > support@lariat.co <ma...@lariat.co>
> 
> 
> 
> ---
> 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. 


Randolf Richardson - randolf@inter-corporate.com
Inter-Corporate Computer & Network Services, Inc.
Beautiful British Columbia, Canada
http://www.inter-corporate.com/



Re: Apache2::Connection::remote_ip

Posted by Dr James Smith <js...@sanger.ac.uk>.
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 <worik.stanton@gmail.com 
> <ma...@gmail.com>> 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?
>     worik.stanton@gmail.com <ma...@gmail.com>
>     021-1680650, (03) 4821804
>                               Aotearoa (New Zealand)
>                                  I voted for love
>
>
>
>
> -- 
> John Dunlap
> /CTO | Lariat/
> /
> /
> /*Direct:*/
> /john@lariat.co <ma...@lariat.co>/
> /
> *Customer Service:*/
> 877.268.6667
> support@lariat.co <ma...@lariat.co>



---
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. 

Re: Apache2::Connection::remote_ip

Posted by John Dunlap <jo...@lariat.co>.
Could you give us a link to the documentation you are using?

On Thu, Nov 20, 2014 at 5:38 PM, worik <wo...@gmail.com> wrote:

> Can't locate object method "remote_ip" via package "Apache2::Connection
>
> 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?
>        worik.stanton@gmail.com 021-1680650, (03) 4821804
>                           Aotearoa (New Zealand)
>                              I voted for love
>



-- 
John Dunlap
*CTO | Lariat *

*Direct:*
*john@lariat.co <jo...@lariat.co>*

*Customer Service:*
877.268.6667
support@lariat.co