On Wed, 2005-05-18 at 20:20 +0200, Sven Wegener wrote:
On Wed, May 18, 2005 at 12:25:11PM +0200, Balazs Scheidler wrote:
Hi,
Thanks for the contribution to syslog-ng and sorry for not answering so long.
The problem I have with your patches that I'd prefer not to rely on getaddrinfo() functions as I'm a bit afraid of portability issues. Are there any other way (with gethostbyaddr for example) to determine network local name?
Hi again!
Well, actualy gethostbyname is the function to go for. What I said in my last email is wrong, I was thinking about gethostbyname but I wrote gethostbyaddr. Please find attached two patches against latest snapshot from the 1.6 and 1.9 series.
Downside of using gethostbyname is that it uses static memory for the result. We're copying the result to our own buffer so this is safe, but from what I saw in the source the 1.6 series seems to or has the ability to use threads. 1.9 does not to use threads itself, but eventlog does. Is there the chance of having two or more threads calling the hostname functions synchronously? I guess you can tell this better than me.
Syslog-ng does not really use threads in neither 1.6 nor 1.9, it is needed by door support on Solaris, but the function running in the separate thread does nothing but acknowledge the message. (door_return) EventLog does not use threads on its own, it only allows using threads in an application using EventLog. I've committed a slightly changed patch to both syslog-ng 1.6 and 1.9. Thanks for your contribution. -- Bazsi