You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@bellsouth.net> on 2001/03/28 20:16:54 UTC

calling ap_get_remote_host() (was Re: cvs commit: httpd-2.0/server config.c)

GOMEZ Henri <hg...@slib.fr> writes:

> On mod_jk up to apache 2.0 alpha14 we used :
> 
> s->remote_host  = (char *)ap_get_remote_host(r->connection,
> r->per_dir_config, REMOTE_HOST);
> 
> now ap_get_remote_host need another parameter and I choose to use
> REMOTE_NAME :
>  
> s->remote_host  = (char *)ap_get_remote_host(r->connection,
> r->per_dir_config, REMOTE_NAME, REMOTE_HOST);
> 
> Did I do the right choice ;)

No...  Take your original call and add ", NULL" for the final
parameter.

The change is to optionally tell the caller whether or not an IP
address was returned.  Callers which don't care should pass NULL.
Since REMOTE_HOST has the same value as NULL you didn't segfault.  The
change to the second parameter might bite you though.

Also, you might look at the doc in http_core.h which describes the
last parameter to ap_get_remote_host() and see if it needs to be
improved.

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...