apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: Networking functions?
Date Tue, 28 Nov 2000 12:42:54 GMT
"David Reid" <dreid@jetnet.co.uk> writes:

> Should we have a function in apr that can take an apr_sockaddr_t and return
> a formatted address string?  I mean we now need to deal with IPv4/IPv6 and
> it'd be nice to abstract the need for different formatting away from the
> client.
> apr_status_t apr_format_address(char *string, apr_sockaddr_t *sa)

That should be "char **string", right?  Would you cache the string in
the apr_sockaddr_t so that it doesn't have to be allocated more than
once?  Otherwise, you might want the caller to pass the storage
(lots of groaning heard, even from the sleepers in other time zones).

> Should we have a flag that we pass in to say what we want (address only,
> address:port, port only)?

Note that we have apr_get_ipaddr() already which formats the address
only.  If you provide this function with the style flag (+1 from me),
you can get rid of apr_get_ipaddr().

Would you use the URL-style format for IPv6 numeric address string and
port (e.g., "[fe80::1]:1080")?

Jeff Trawick | trawick@ibm.net | PGP public key at web site:
          Born in Roswell... married an alien...

View raw message