]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: ssl: remove opendir call in ssl_sock_load_cert
authorWilliam Dauchy <w.dauchy@criteo.com>
Mon, 13 Jan 2020 16:52:49 +0000 (17:52 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 13 Jan 2020 18:51:52 +0000 (19:51 +0100)
commit9a8ef7f51d2b5a21081f552780207130cfd6a7d5
tree6173d18f592f8ba4541b7a7bd9a3dd2ba205e730
parent70c5b0e5fd5ad243f4645b37a0f89068de97e90e
CLEANUP: ssl: remove opendir call in ssl_sock_load_cert

Since commit 3180f7b55434 ("MINOR: ssl: load certificates in
alphabetical order"), `readdir` was replaced by `scandir`. We can indeed
replace it with a check on the previous `stat` call.

This micro cleanup can be a good benefit when you have hundreds of bind
lines which open TLS certificates directories in terms of syscall,
especially in a case of frequent reloads.

Signed-off-by: William Dauchy <w.dauchy@criteo.com>
src/ssl_sock.c