summaryrefslogtreecommitdiffstats
path: root/src/ogAdmServer.c
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-07-10 13:13:59 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-07-10 16:21:58 +0200
commit0631b0e8e6fdf77d0bbe6715e0cb2c4bdb872b12 (patch)
treec08667b1f938675a6cbb61ed55b498df58d8716d /src/ogAdmServer.c
parenta8eccba7066047997543970b83cb8f371923833f (diff)
#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.
Diffstat (limited to 'src/ogAdmServer.c')
-rw-r--r--src/ogAdmServer.c5
1 files changed, 5 insertions, 0 deletions
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]) {