From 0631b0e8e6fdf77d0bbe6715e0cb2c4bdb872b12 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Fri, 10 Jul 2020 13:13:59 +0200 Subject: #988 Add DB port option to ogserver.json config file This patch provides functionality to select a database port. It also adds a default IP for the database. --- src/ogAdmServer.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ogAdmServer.c') diff --git a/src/ogAdmServer.c b/src/ogAdmServer.c index f8a50ae..3ba5b30 100644 --- a/src/ogAdmServer.c +++ b/src/ogAdmServer.c @@ -31,6 +31,7 @@ char interface[4096]; // Interface name char auth_token[4096]; // API token char servidoradm[4096]; // Dirección IP del servidor de administración char puerto[4096]; // Puerto de comunicación +char db_port[4096]; SOCKETCL tbsockets[MAXIMOS_CLIENTES]; @@ -38,6 +39,7 @@ struct og_dbi_config dbi_config = { .user = usuario, .passwd = pasguor, .host = datasource, + .port = db_port, .database = catalog, }; @@ -101,6 +103,9 @@ bool tomaConfiguracion(const char *filecfg) line = fgets(buf, sizeof(buf), fcfg); } + /* Default value to preserve legacy config file support */ + snprintf(db_port, sizeof(db_port), "3306"); + fclose(fcfg); if (!servidoradm[0]) { -- cgit v1.2.3-18-g5258