From fd8d4d3d383f59742c7db782c140e5a158fbd0a0 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 5 Feb 2018 19:08:31 +1100 Subject: [PATCH] [client] enable configuration of spice via config --- client/main.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/client/main.c b/client/main.c index 3185a35a..a0ed43ee 100644 --- a/client/main.c +++ b/client/main.c @@ -1143,6 +1143,30 @@ static bool load_config(const char * configFile) } } + config_setting_t * spice = config_lookup(&cfg, "spice"); + if (spice) + { + if (config_setting_lookup_bool(spice, "use", &itmp)) + params.useSpice = (itmp != 0); + + if (config_setting_lookup_string(spice, "host", &stmp)) + { + free(params.spiceHost); + params.spiceHost = strdup(stmp); + } + + if (config_setting_lookup_int(spice, "port", &itmp)) + { + if (itmp < 1) + { + DEBUG_ERROR("Invalid spice port"); + config_destroy(&cfg); + return false; + } + params.spicePort = itmp; + } + } + for(unsigned int i = 0; i < LG_RENDERER_COUNT; ++i) { const LG_Renderer * r = LG_Renderers[i]; @@ -1450,4 +1474,4 @@ int main(int argc, char * argv[]) } return ret; -} +} \ No newline at end of file