]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10496: [mod_v8] Fixing regression from FS-10496 when no settings exist in v8.conf.
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Sun, 28 Jan 2018 15:18:58 +0000 (10:18 -0500)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Sun, 28 Jan 2018 15:18:58 +0000 (10:18 -0500)
src/mod/languages/mod_v8/mod_v8.cpp

index 2a295283dd5da0fc3a0245f28bdcac3da7a012d2..636b93e5aca0b77b41225a0970a938356237862b 100644 (file)
@@ -358,12 +358,6 @@ static void load_configuration(void)
                                }
                        }
 
-#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
-                       if (zstr(globals.script_caching)) {
-                               globals.script_caching = switch_core_strdup(globals.pool, "disabled");
-                       }
-#endif
-
                        for (hook = switch_xml_child(settings, "hook"); hook; hook = hook->next) {
                                char *event = (char *)switch_xml_attr_soft(hook, "event");
                                char *subclass = (char *)switch_xml_attr_soft(hook, "subclass");
@@ -533,7 +527,7 @@ void LoadScript(MaybeLocal<v8::Script> *v8_script, Isolate *isolate, const char
                Do not cache if the caching is disabled
                Do not cache inline scripts
        */
-       if (!strcasecmp(globals.script_caching, "disabled") || !strcasecmp(globals.script_caching, "false") || !strcasecmp(globals.script_caching, "no") ||     !strcasecmp(script_file, "inline") || zstr(script_file)) {
+       if (!switch_true(globals.script_caching) || !strcasecmp(script_file, "inline") || zstr(script_file)) {
                options = ScriptCompiler::kNoCompileOptions;
                perf_log("Javascript caching is disabled.\n", script_file);
        } else {
@@ -1212,6 +1206,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_v8_load)
        globals.v8platform = NULL;
        globals.cache_expires_seconds = 0;
        globals.performance_monitor = false;
+       globals.script_caching = switch_core_strdup(globals.pool, "disabled");
+
        JSMain::Initialize(&globals.v8platform);
 
        switch_core_hash_init(&globals.compiled_script_hash);