From: Ben Noordhuis Date: Tue, 27 Aug 2013 14:14:45 +0000 (+0200) Subject: src: remove two pointless globals from node.cc X-Git-Tag: v0.11.7~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d567f43d01bc0ab400b879ed19760468149fcf7;p=platform%2Fupstream%2Fnodejs.git src: remove two pointless globals from node.cc De-globalize use_npn and use_sni, they're only used in GetFeatures(). --- diff --git a/src/node.cc b/src/node.cc index 1a410cf..b8270f7 100644 --- a/src/node.cc +++ b/src/node.cc @@ -187,18 +187,6 @@ static struct { uint32_t count; } domain_flag; -#ifdef OPENSSL_NPN_NEGOTIATED -static bool use_npn = true; -#else -static bool use_npn = false; -#endif - -#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB -static bool use_sni = true; -#else -static bool use_sni = false; -#endif - // process-relative uptime base, initialized at start-up static double prog_start_time; @@ -2222,10 +2210,20 @@ static Handle GetFeatures() { // TODO(bnoordhuis) ping libuv obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "ipv6"), True(node_isolate)); - obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "tls_npn"), - Boolean::New(use_npn)); - obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "tls_sni"), - Boolean::New(use_sni)); +#ifdef OPENSSL_NPN_NEGOTIATED + Local tls_npn = True(node_isolate); +#else + Local tls_npn = False(node_isolate); +#endif + obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "tls_npn"), tls_npn); + +#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB + Local tls_sni = True(node_isolate); +#else + Local tls_sni = False(node_isolate); +#endif + obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "tls_sni"), tls_sni); + obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "tls"), Boolean::New(get_builtin_module("crypto") != NULL));