When you build mod_jk for apache 2 _REENTRANT will be defined if
it is needed by apache. A simple #ifdef will work. I already did this but when I tested it caused other problems.
I haven't had a chance yet to go back and fully test and debug
this change. I'll get to it this week.
Or maybe we should delegate it to APR if we detect it in build :
find_adresses seems a good candidate and when you see all the OS case it handle, it's better use APR in such case isn't it ?
We don't use APR anywhere in mod_jk 1.2 except inside the apache 2 mod_jk.c. No reason to require APR for all OS/servers for just this one thing.
I understand but gethostbyname_r need many tweaking (from what I could see in apr sockaddr.c) :
Note the check for AIX/HPUP/DUX/LINUX/GLIBC2/SOLARIS/IRIX.... ....
#if defined(GETHOSTBYNAME_R_HOSTENT_DATA) /* AIX, HP/UX, D/UX et alia */ gethostbyname_r(hostname, &hs, &hd); hp = &hs; #else #if defined(GETHOSTBYNAME_R_GLIBC2) /* Linux glibc2+ */ gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hp, &hosterror); #else /* Solaris, Irix et alia */ hp = gethostbyname_r(hostname, &hs, tmp, GETHOSTBYNAME_BUFLEN - 1, &hosterror); #endif /* !defined(GETHOSTBYNAME_R_GLIBC2) */ if (!hp) { return (hosterror + APR_OS_START_SYSERR); } #endif /* !defined(GETHOSTBYNAME_R_HOSTENT_DATA) */ #else hp = gethostbyname(hostname); #endif
....
So the idea will be to use APR implementation when we detect that APR is available (configure should be updated accordingly).
And under Apache 2.0, APR is allways available !
Apache 1.3 use fork mode under Unix, so no thread problem.
For Windows I wonder what happen, may be the implementation is safe ?
BTW, using APR will remove the #idef AS400 ;)
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]