]> git.ipfire.org Git - thirdparty/openssl.git/commit
Use gethostbyname_r if available
authorManikantan Subramanian <mani.on.gtalk@gmail.com>
Tue, 18 Sep 2018 01:54:13 +0000 (18:54 -0700)
committerRichard Levitte <levitte@openssl.org>
Wed, 26 Sep 2018 06:37:59 +0000 (08:37 +0200)
commit2b872562f56b6039179104657edddac22712d994
tree92a8d76d18784278d7996151a876cd5fddabc5c1
parent7a6d121e9d7bbd3a0db0a7b8020cfa224fe3aaa5
Use gethostbyname_r if available

Fixes #7228

The function BIO_get_host_ip uses gethostbyname, which is not thread safe
and hence we grab a lock. In multi-threaded applications, this lock sometimes
causes performance bottlenecks.
This patch uses the function gethostbyname_r (thread safe version), when
available.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7250)
crypto/bio/b_sock.c