apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <...@manyfish.co.uk>
Subject Re: cvs commit: apr/include apr_network_io.h
Date Thu, 18 Sep 2003 12:06:20 GMT
On Wed, Sep 17, 2003 at 10:23:48AM -0400, Jeff Trawick wrote:
> jorton@apache.org wrote:
> >jorton      2003/09/17 07:19:17
> >
> >  Modified:    include  apr_network_io.h
> >  Log:
> >  Move the 'sa' field to the end of the structure, to ensure
> >  binary compatibility between a libapr built with IPv6 support
> >  and one built without.
> good move!

>From talking to some guys at work this isn't actually good enough, when
the size of 'sa' changes its offset may also change because of alignment

> one of my evil twins considered allocating the socket address separately

Another idea is to add a sockaddr_storage into the union to make sure
it's a fixed size on platforms which have sockaddr_storage regardless of
APR_HAVE_IPV6. I like that or dynamic allocation...

Using dynamic allocation means tweaking lots of code, and it would be
hard for an app to be source-compatible with 1.0 and 0.9.x unless we
added icky macros to both.

Using sockaddr_storage means the APR ABI is still vulnerable to change
across different versions of a particular platform, though I'm not sure
if I care too much about that, so I'm swaying towards using

> the other one wondered about putting some reserved space in front of the 
> sa union in case we need more fields later, but that may be problematic 
> since apps can build the structure themself
> on another topic...  what about binary compatibility regardless of large 
> file support :)

I'm planning to look at it soon :)


ps. mind the hurricane

View raw message