httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject calling ap_get_remote_host() (was Re: cvs commit: httpd-2.0/server config.c)
Date Wed, 28 Mar 2001 18:16:54 GMT
GOMEZ Henri <hgomez@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...

Mime
View raw message