diff --git a/lib/core-net/close.c b/lib/core-net/close.c index fe1af3c51..736002348 100644 --- a/lib/core-net/close.c +++ b/lib/core-net/close.c @@ -1076,10 +1076,6 @@ lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, const char *ca { struct lws_context *cx = wsi->a.context; struct lws_context_per_thread *pt = &wsi->a.context->pt[(int)wsi->tsi]; - - /* if the user sets the sniffing flag, populate the key log file */ - lws_set_keylog_file(wsi); - /* if the user sets the sniffing flag, populate the key log file */ lws_set_keylog_file(wsi); diff --git a/lib/plat/windows/windows-init.c b/lib/plat/windows/windows-init.c index 381ce75be..9b114b5fc 100644 --- a/lib/plat/windows/windows-init.c +++ b/lib/plat/windows/windows-init.c @@ -106,10 +106,12 @@ lws_plat_init(struct lws_context *context, #if defined(LWS_HAVE_SSL_CTX_set_keylog_callback) && \ defined(LWS_WITH_TLS) && defined(LWS_WITH_CLIENT) - { + { char *klf_env = getenv("SSLKEYLOGFILE"); - if(klf_env) - lws_strncpy(context->keylog_file, klf_env, sizeof(context->keylog_file)); + + if (klf_env) + lws_strncpy(context->keylog_file, klf_env, + sizeof(context->keylog_file)); } #endif