apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Pocock <dan...@pocock.com.au>
Subject apr_socket_t hacking
Date Wed, 06 Feb 2013 20:59:43 GMT


I've observed (and expanded upon) a slightly naughty use case of
apr_socket_t in the Ganglia code base

Specifically, Ganglia tries to get the raw socket and use it for a
couple of things like getsockopt, as apr_getsockopt doesn't seem to work
on older apr versions:

http://www.mail-archive.com/ganglia-developers@lists.sourceforge.net/msg06179.html

So we do this little trick, defining the struct in our own code:

https://github.com/ganglia/monitor-core/blob/master/lib/apr_net.c#L20

More recently, I wanted to add optional TLS support to dynalogin.  It
also uses APR sockets.  I repeated the same trick, but I'd prefer to
find a more elegant solution than:

https://github.com/dynalogin/dynalogin/blob/master/dynalogind/dynalogind.c#L429
 (accessing socketdes)

Can anyone comment on this?  In particular, how to get the socket, or
how to make TLS work with APR in some other way?


Mime
View raw message