The length of buffer supplied to gethostbyname_r API is hard-coded to 1024. While the expected output on my machine is more than 1024.
The limit should be increased in future release.
Neha Agarwalla wrote:
Our client has a failover setup wherein they have multiple ldap servers.
When they ping to this particular hostname "thcg.net" then it returns the
IP address of the LDAP server currently being used.
If we configure the particular IP address as the hostname in our
application then we are able to connect to ldap successfully. But if we
configure "thcg.net" as the hostname then we are unable to connect. In
effect our application is not able use the functionality fail-over. The
ldap_simple_bind_s() API fails with error code as 91 and the error message
as "Can't connect to LDAP server'.