]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Merge insp20
authorAttila Molnar <attilamolnar@hush.com>
Fri, 2 Sep 2016 18:58:58 +0000 (20:58 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Fri, 2 Sep 2016 18:58:58 +0000 (20:58 +0200)
1  2 
src/modules/extra/m_sqlite3.cpp
src/modules/m_jumpserver.cpp

index 05203da39c6ae7fb464a33ffe33f7ed3781cb047,47880c02c51ef83a5585e886eabe11e94bda1b39..8c07bfc6aa60e601bb001b6cdff6dec4731a90b2
@@@ -91,8 -90,10 +91,10 @@@ class SQLConn : public SQLProvide
                std::string host = tag->getString("hostname");
                if (sqlite3_open_v2(host.c_str(), &conn, SQLITE_OPEN_READWRITE, 0) != SQLITE_OK)
                {
-                       ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "WARNING: Could not open DB with id: " + tag->getString("id"));
+                       // Even in case of an error conn must be closed
+                       sqlite3_close(conn);
                        conn = NULL;
 -                      ServerInstance->Logs->Log("m_sqlite3",DEFAULT, "WARNING: Could not open DB with id: " + tag->getString("id"));
++                      ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "WARNING: Could not open DB with id: " + tag->getString("id"));
                }
        }
  
index f59ef045d1a0b4c5eeb9cf912ac4251b96e0b52c,44c6fc0d9fb20cfbd11c5a23015faac793c73f36..89391c8a4bf6268e3ae8c6e438787049e1491bf0
@@@ -155,14 -143,25 +155,14 @@@ class ModuleJumpServer : public Modul
        {
        }
  
 -      void init()
 +      ModResult OnUserRegister(LocalUser* user) CXX11_OVERRIDE
        {
 -              ServerInstance->Modules->AddService(js);
 -              Implementation eventlist[] = { I_OnUserRegister, I_OnRehash };
 -              ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
 -      }
 -
 -      virtual ~ModuleJumpServer()
 -      {
 -      }
 -
 -      virtual ModResult OnUserRegister(LocalUser* user)
 -      {
 -              if (js.port && js.redirect_new_users)
 +              if (js.redirect_new_users)
                {
 -                      user->WriteNumeric(10, "%s %s %d :Please use this Server/Port instead",
 -                              user->nick.c_str(), js.redirect_to.c_str(), js.port);
 +                      int port = js.GetPort(user);
 +                      user->WriteNumeric(RPL_REDIR, js.redirect_to, port, "Please use this Server/Port instead");
                        ServerInstance->Users->QuitUser(user, js.reason);
-                       return MOD_RES_PASSTHRU;
+                       return MOD_RES_DENY;
                }
                return MOD_RES_PASSTHRU;
        }