From 78f060779e99370bcf8dea817ea33c82635d3205 Mon Sep 17 00:00:00 2001 From: Jianhui Zhao Date: Sun, 31 Dec 2017 17:28:27 +0800 Subject: [PATCH] Optimize code Signed-off-by: Jianhui Zhao --- src/uh_ssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/uh_ssl.c b/src/uh_ssl.c index e3d9051..01e5a15 100755 --- a/src/uh_ssl.c +++ b/src/uh_ssl.c @@ -32,7 +32,6 @@ int uh_ssl_init(struct uh_server *srv, const char *key, const char *crt) if (_init) return 0; - _init = true; dlh = dlopen("libustream-ssl.so", RTLD_LAZY | RTLD_LOCAL); if (!dlh) { uh_log_err("Failed to load ustream-ssl library: %s", dlerror()); @@ -57,6 +56,8 @@ int uh_ssl_init(struct uh_server *srv, const char *key, const char *crt) return -EINVAL; } + _init = true; + return 0; }