X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fnetwork%2Fserv_netconfig.c;h=4f5eac42194a6c97f9f36791640262cd807c5719;hb=da1debddf5988512ac50ff0b62ac85c8f3b8d0f4;hp=970057133bb4e4c49dedbdf6bb92d453034e7c05;hpb=8b276ba2d09c1d606b6b282961c737b6b4e26d21;p=citadel.git diff --git a/citadel/modules/network/serv_netconfig.c b/citadel/modules/network/serv_netconfig.c index 970057133..4f5eac421 100644 --- a/citadel/modules/network/serv_netconfig.c +++ b/citadel/modules/network/serv_netconfig.c @@ -92,43 +92,26 @@ #include "ctdl_module.h" -/* - * We build a map of network nodes during processing. - */ -NetMap *the_netmap = NULL; -int netmap_changed = 0; -char *working_ignetcfg = NULL; - /* * Load or refresh the Citadel network (IGnet) configuration for this node. */ -void load_working_ignetcfg(void) { - char *cfg; - char *oldcfg; - - cfg = CtdlGetSysConfig(IGNETCFG); - if (cfg == NULL) { - cfg = strdup(""); - } - - oldcfg = working_ignetcfg; - working_ignetcfg = cfg; - if (oldcfg != NULL) { - free(oldcfg); - } +char* load_working_ignetcfg(void) { + return CtdlGetSysConfig(IGNETCFG); } + /* * Read the network map from its configuration file into memory. */ -void read_network_map(void) { +NetMap *read_network_map(void) { char *serialized_map = NULL; int i; char buf[SIZ]; - NetMap *nmptr; + NetMap *nmptr, *the_netmap; + the_netmap = NULL; serialized_map = CtdlGetSysConfig(IGNETMAP); - if (serialized_map == NULL) return; /* if null, no entries */ + if (serialized_map == NULL) return NULL; /* if null, no entries */ /* Use the string tokenizer to grab one line at a time */ for (i=0; i", node); cprintf("%d Already talking to %s right now\n", ERROR + RESOURCE_BUSY, node); + free(working_ignetcfg); return; } safestrncpy(CC->net_node, node, sizeof CC->net_node); - network_talking_to(node, NTT_ADD); + network_talking_to(node, nodelen, NTT_ADD); syslog(LOG_NOTICE, "Network node <%s> logged in from %s [%s]\n", CC->net_node, CC->cs_host, CC->cs_addr ); cprintf("%d authenticated as network node '%s'\n", CIT_OK, CC->net_node); + free(working_ignetcfg); } int netconfig_check_roomaccess(