]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Cleanup 11823/head
authorFred Morcos <fred.morcos@open-xchange.com>
Wed, 3 Aug 2022 11:34:01 +0000 (13:34 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Thu, 1 Sep 2022 08:31:52 +0000 (10:31 +0200)
pdns/recursordist/rec-main.cc

index c248fcfc8b2d53bf8c1e26d474e359e0df2dcfdc..40f4af10d4deef33a717786c319b2c6c18af4d64 100644 (file)
@@ -2955,16 +2955,15 @@ static RecursorControlChannel::Answer* doReloadLuaScript()
       g_log << Logger::Info << RecThreadInfo::id() << " Unloaded current lua script" << endl;
       return new RecursorControlChannel::Answer{0, string("unloaded\n")};
     }
-    else {
-      t_pdl = std::make_shared<RecursorLua4>();
-      try {
-        t_pdl->loadFile(fname);
-      }
-      catch (std::runtime_error& ex) {
-        string msg = std::to_string(RecThreadInfo::id()) + " Retaining current script, could not read '" + fname + "': " + ex.what();
-        g_log << Logger::Error << msg << endl;
-        return new RecursorControlChannel::Answer{1, msg + "\n"};
-      }
+
+    t_pdl = std::make_shared<RecursorLua4>();
+    try {
+      t_pdl->loadFile(fname);
+    }
+    catch (std::runtime_error& ex) {
+      string msg = std::to_string(RecThreadInfo::id()) + " Retaining current script, could not read '" + fname + "': " + ex.what();
+      g_log << Logger::Error << msg << endl;
+      return new RecursorControlChannel::Answer{1, msg + "\n"};
     }
   }
   catch (std::exception& e) {