apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sterling Hughes <sterl...@designmultimedia.com>
Subject gethostby_r routines
Date Mon, 30 Jul 2001 08:19:40 GMT
    Hi,

    I was going through the APR source and I noticed that currently the
    implementation of gethostbyname_r is incorrect (wrap everything i
    say with an imho ;).  Also, there was no implementation of the
    gethostbyaddr_r() function call.

    gethostbyname_r() and gethostbyaddr_r() are implemented differently
    on different os's.  There are three different implementations that I
    know of.  Currently the APR source only accounts for one of these
    functions, and doesn't detect the differences.  The attached patch is
    a configure.in patch to detect the correct version of the gethostby_r
    functions (glibc2, solaris, other), a set of wrapper functions in
    sa_common.c and the necessary source code updates.

    I don't have a variety of OS' to test this on, however, on a Linux
    glibc2 system, the client and the server programs in the tests
    directory both worked without issue.  I've also used similair code
    in other projects, and its worked there (ie, the concept is pretty
    well tested, this implementation needs testing on the other
    platforms).

    Ahh, well, that's pretty much it :).  Comments? Questions?

    Sterling Hughes
    sterling@php.net

    References: The MySQL source and cURL source use similair concepts
    and implementations (the configure macro is a slightly modified port
    of the MySQL macro's to APR).

Mime
View raw message