You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2004/08/18 03:24:10 UTC

[mp2] dropping $c->remote_host?

The Apache docs say not to access directly $c->remote_host() but always 
call $c->get_remote_host. I see that mp1 had both with the suggestion not 
to use $c->remote_host(). I suggest that we drop $c->remote_host()
but it's somewhat related to the earlier suggestion to make 
$c->remote_host settable, so I'm not sure what is the right thing to do.

Comments?


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] dropping $c->remote_host?

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
> 
> Stas Bekman wrote:
> 
>>The Apache docs say not to access directly $c->remote_host() but always
>>call $c->get_remote_host. I see that mp1 had both with the suggestion
>>not to use $c->remote_host(). I suggest that we drop $c->remote_host()
>>but it's somewhat related to the earlier suggestion to make
>>$c->remote_host settable, so I'm not sure what is the right thing to do.
>>
>>Comments?
> 
> 
> I think I prefer to keep it and (possibly) make it writable.  the reason to
> use ap_get_remote_host over c->remote_host is because ap_get_remote_host
> respects UseCanonicalName settings from the config, allowing them to control
> how deep trying to dig out the remote_host goes.  I think reading from
> c->remote_host is not necessarily wrong (since it looks to get set so long
> as ap_get_remote_host is called at all), but that it doesn't necessarily
> contain consistent information from request to request.
> 
> on the other hand, I see writing to c->remote_host as being useful for
> mocking up clients and such in that sneaky kind of way that mod_perl users
> are famous for.

OK


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] dropping $c->remote_host?

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Stas Bekman wrote:
> The Apache docs say not to access directly $c->remote_host() but always
> call $c->get_remote_host. I see that mp1 had both with the suggestion
> not to use $c->remote_host(). I suggest that we drop $c->remote_host()
> but it's somewhat related to the earlier suggestion to make
> $c->remote_host settable, so I'm not sure what is the right thing to do.
> 
> Comments?

I think I prefer to keep it and (possibly) make it writable.  the reason to
use ap_get_remote_host over c->remote_host is because ap_get_remote_host
respects UseCanonicalName settings from the config, allowing them to control
how deep trying to dig out the remote_host goes.  I think reading from
c->remote_host is not necessarily wrong (since it looks to get set so long
as ap_get_remote_host is called at all), but that it doesn't necessarily
contain consistent information from request to request.

on the other hand, I see writing to c->remote_host as being useful for
mocking up clients and such in that sneaky kind of way that mod_perl users
are famous for.

--Geoff

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org