apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: apr_portable.h and const struct sockaddr * - getting bonjour to work
Date Mon, 07 Mar 2011 15:28:57 GMT
On Wed, Mar 02, 2011 at 01:27:47AM +0200, Graham Leggett wrote:
> Hi all,
> 
> I am currently struggling to get DNSServiceGetAddrInfo() from
> zeroconf to work nicely with apr_portable.h, and need to clarify
> whether I am missing anything.
> 
> DNSServiceGetAddrInfo() returns the DNS lookup in a structure
> "struct sockaddr *" which I need to convert into an "apr_sockaddr_t
> *", but I am struggling to find the corresponding function to do it.
> Is this an oversight in apr or have I missed something?

Hiya - there is nothing to stop you from populating the apr_sockaddr_t 
"by hand" since the structure is not opaque; you have to duplicate the 
functionality (or a subset) of apr_sockaddr_vars_set() to set up the 
pointers appropriately.  I wouldn't see a problem with adding a new 
function which took (pool, struct sockaddr *) and did this internally.

Regards, Joe

Mime
View raw message