Re: Apache2::Connection::remote_ip

"Randolf Richardson" <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Organization Inter-Corporate Computer & Network Services
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 );

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


Randolf Richardson - [email protected]
Inter-Corporate Computer & Network Services, Inc.
Beautiful British Columbia, Canada
http://www.inter-corporate.com/
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.