Browse Source

src: remove two pointless globals from node.cc

De-globalize use_npn and use_sni, they're only used in GetFeatures().
v0.11.7-release
Ben Noordhuis 11 years ago
parent
commit
8d567f43d0
  1. 30
      src/node.cc

30
src/node.cc

@ -187,18 +187,6 @@ static struct {
uint32_t count; uint32_t count;
} domain_flag; } 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 // process-relative uptime base, initialized at start-up
static double prog_start_time; static double prog_start_time;
@ -2222,10 +2210,20 @@ static Handle<Object> GetFeatures() {
// TODO(bnoordhuis) ping libuv // TODO(bnoordhuis) ping libuv
obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "ipv6"), True(node_isolate)); obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "ipv6"), True(node_isolate));
obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "tls_npn"), #ifdef OPENSSL_NPN_NEGOTIATED
Boolean::New(use_npn)); Local<Boolean> tls_npn = True(node_isolate);
obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "tls_sni"), #else
Boolean::New(use_sni)); Local<Boolean> 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<Boolean> tls_sni = True(node_isolate);
#else
Local<Boolean> 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"), obj->Set(FIXED_ONE_BYTE_STRING(node_isolate, "tls"),
Boolean::New(get_builtin_module("crypto") != NULL)); Boolean::New(get_builtin_module("crypto") != NULL));

Loading…
Cancel
Save