You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Sean T Allen <se...@usaherbals.com> on 2004/11/18 09:55:19 UTC

[mp2] Usage: Apache::Connection::remote_ip(obj) error

apache 2.0.52
mod_perl 1.99_17
perl 5.8.0

code in question:


package ProxyRemoteAddr;

use Apache::Const qw(OK);
use strict;

sub handler
{
    my $r = shift;

    return OK unless ( $r->connection->remote_ip eq '127.0.0.1' ) &&
                       $r->header_in( 'X-Forwarded-For' );

    if ( my ( $ip ) = $r->headers_in->{ 'X-Forwarded-For' } =~ 
/([^,\s]+)$/ )
    {
        $r->connection->remote_ip($ip);
    }

    return OK;
}

1;

Internal server error thrown error message:

[Thu Nov 18 01:48:49 2004] [error] [client 127.0.0.1] Usage: 
Apache::Connection::remote_ip(obj) at /ai/toppik/lib/ProxyRemoteAddr.pm 
line 15.\n

Line 15 being the:         $r->connection->remote_ip($ip);

I've seen numerous examples of this working. Any ideas on my problem?

Thanks in advance...

-Sean-






Re: [mp2] Usage: Apache::Connection::remote_ip(obj) error

Posted by Tom Schindl <to...@gmx.at>.
Sean T Allen wrote:
> Tom...
> 
> I see a 'AuthenNTLM' patch.
> 
> but nothing specific to remote ip...
> 
> which patch am i looking for on that page?
> 
> Tom Schindl wrote:
> 

Uups:
http://gossamer-threads.com/lists/modperl/modperl/74104?search_string=Report%20on%20mp2%20accessors%20in%20apache_structures.map;#74104

is much more appropiate, but the reason is the same. You'll have to 
patch apache_structures.map to make it writeable once more. Simply 
remove the < symbol in front of remote_ip.

Tom

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] Usage: Apache::Connection::remote_ip(obj) error

Posted by Tom Schindl <to...@gmx.at>.
Sean T Allen wrote:
> apache 2.0.52
> mod_perl 1.99_17
> perl 5.8.0
> 
> code in question:
> 
> 
> package ProxyRemoteAddr;
> 
> use Apache::Const qw(OK);
> use strict;
> 
> sub handler
> {
>    my $r = shift;
> 
>    return OK unless ( $r->connection->remote_ip eq '127.0.0.1' ) &&
>                       $r->header_in( 'X-Forwarded-For' );
> 
>    if ( my ( $ip ) = $r->headers_in->{ 'X-Forwarded-For' } =~ 
> /([^,\s]+)$/ )
>    {
>        $r->connection->remote_ip($ip);
>    }
> 
>    return OK;
> }
> 
> 1;

http://gossamer-threads.com/lists/engine?list=modperl&do=search_results&search_forum=forum_4&search_string=%22Report+on+mp2+accessors+in+apache_structures.map%22&search_type=AND

yes its readonly since _15, in cvs/svn it's writeable once more.

A patch against can be found here:
http://gossamer-threads.com/lists/modperl/modperl/73063?search_string=Apache-AuthenNTLM-2.07%20and%20ModPerl%201.99_16;#73063

Tom

> 
> Internal server error thrown error message:
> 
> [Thu Nov 18 01:48:49 2004] [error] [client 127.0.0.1] Usage: 
> Apache::Connection::remote_ip(obj) at /ai/toppik/lib/ProxyRemoteAddr.pm 
> line 15.\n
> 
> Line 15 being the:         $r->connection->remote_ip($ip);
> 
> I've seen numerous examples of this working. Any ideas on my problem?
> 
> Thanks in advance...
> 
> -Sean-
> 
> 
> 
> 
> 


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html