From 83360abc1cdde5dc5e7bc0ee499dbe83bb46063d Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Sun, 6 Mar 2016 23:29:36 +0100 Subject: [PATCH] Modified preferences nBox label Fifed MySQL connection leak in case of reconnection --- scripts/lua/admin/prefs.lua | 4 ++-- src/MySQLDB.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/lua/admin/prefs.lua b/scripts/lua/admin/prefs.lua index 50ac400cfb..7a58e25166 100644 --- a/scripts/lua/admin/prefs.lua +++ b/scripts/lua/admin/prefs.lua @@ -85,7 +85,7 @@ if (ntop.isPro()) then prefsInputField("Nagios service_description", "The service description exactly as specified in Nagios passive service definition for the ntopng host. Default: NtopngAlert", "nagios_service_name", prefs.nagios_service_name) end -- ================================================================================ - print('nBox integration') + print('nBox Integration') local nbox_integration = ntop.getCache("ntopng.prefs.nbox_integration") local nbox_host = ntop.getCache("ntopng.prefs.nbox_host") @@ -96,7 +96,7 @@ if (ntop.isPro()) then if((nbox_user == nil) or (nbox_user == "")) then nbox_user = "nbox" end if((nbox_password == nil) or (nbox_password == "")) then nbox_password = "nbox" end - toggleTableButton("Integrate with nBox", + toggleTableButton("Enable nBox Support", "Enable sending ntopng requests (e.g., to download pcap files) to an nBox. Pcap requests are issued from the historical data browser when browsing 'Talkers' and 'Protocols'. Each request carry information on the search criteria generated by the user when drilling-down historical data. Requests are queued and pcaps become available for download from a dedicated 'Pcaps' tab once generated.", "On", "1", "success", "Off", "0", "danger", "toggle_nbox_integration", "ntopng.prefs.nbox_integration") if ntop.getCache("ntopng.prefs.nbox_integration") == "1" then diff --git a/src/MySQLDB.cpp b/src/MySQLDB.cpp index 76387c01e0..08debb79d9 100644 --- a/src/MySQLDB.cpp +++ b/src/MySQLDB.cpp @@ -477,6 +477,7 @@ int MySQLDB::exec_sql_query(lua_State *vm, char *sql, bool limitRows) { ntop->getTrace()->traceEvent(TRACE_ERROR, "MySQL error: [%s][%d]", get_last_db_error(&mysql), rc); + mysql_close(&mysql); if(m) m->unlock(__FILE__, __LINE__); connectToDB(&mysql, true);