You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Stas Bekman <st...@stason.org> on 2003/12/17 21:03:47 UTC
deprecated apr_sockaddr_ip_set replacement?
We are syncing mod_perl-2 API with apr and removing deprecated functions. I
fail to figure out what apr_sockaddr_ip_set was replaced with:
/**
* Set the IP address in an APR socket address.
* @param sockaddr The socket address to use
* @param addr The IP address to attach to the socket.
* Use APR_ANYADDR to use any IP addr on the machine.
* @deprecated @see apr_sockaddr_info_get
*/
APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr,
const char *addr);
I can't see how apr_sockaddr_info_get replaces apr_sockaddr_ip_set. Shouldn't
the deprecated notes, say: use direct access to set ip or what? Or should it
just say, don't do that?
Thank you.
__________________________________________________________________
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
Re: deprecated apr_sockaddr_ip_set replacement?
Posted by Stas Bekman <st...@stason.org>.
Jeff Trawick wrote:
> Stas Bekman wrote:
>
>> /**
>> * Set the IP address in an APR socket address.
>> * @param sockaddr The socket address to use
>> * @param addr The IP address to attach to the socket.
>> * Use APR_ANYADDR to use any IP addr on the machine.
>> * @deprecated @see apr_sockaddr_info_get
>> */
>> APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr,
>> const char *addr);
>>
>> I can't see how apr_sockaddr_info_get replaces apr_sockaddr_ip_set.
>> Shouldn't the deprecated notes, say: use direct access to set ip or
>> what? Or should it just say, don't do that?
>
>
> The only recommended way to get an IP address into a apr_sockaddr_t is
> to call apr_sockaddr_info_get(), which is not a direct replacement for
> apr_sockaddr_ip_set().
>
> Maybe the answer is "don't do that," since you can't do exactly what
> apr_sockaddr_ip_set() did. But apr_sockaddr_info_get() can be used to
> achieve the same goal.
Thanks, Jeff!
__________________________________________________________________
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
Re: deprecated apr_sockaddr_ip_set replacement?
Posted by Jeff Trawick <tr...@attglobal.net>.
Stas Bekman wrote:
> /**
> * Set the IP address in an APR socket address.
> * @param sockaddr The socket address to use
> * @param addr The IP address to attach to the socket.
> * Use APR_ANYADDR to use any IP addr on the machine.
> * @deprecated @see apr_sockaddr_info_get
> */
> APR_DECLARE(apr_status_t) apr_sockaddr_ip_set(apr_sockaddr_t *sockaddr,
> const char *addr);
>
> I can't see how apr_sockaddr_info_get replaces apr_sockaddr_ip_set.
> Shouldn't the deprecated notes, say: use direct access to set ip or
> what? Or should it just say, don't do that?
The only recommended way to get an IP address into a apr_sockaddr_t is to call
apr_sockaddr_info_get(), which is not a direct replacement for
apr_sockaddr_ip_set().
Maybe the answer is "don't do that," since you can't do exactly what
apr_sockaddr_ip_set() did. But apr_sockaddr_info_get() can be used to achieve
the same goal.