From 63bbc710b23893742e5ccbd430f95bf2d29c2da6 Mon Sep 17 00:00:00 2001 From: Jakub Sławiński Date: Thu, 3 Nov 2005 20:37:56 +0100 Subject: v0.7.4 - Fixed: sockets in CLOSE_WAIT state left by afclient - Added: --localname and --localport options - Added: --localdesname option - Added: kicking user in 'opening' state - Fixed: info about kicked user - Fixed: TERM signal handling - Fixed: id lost after reconnection - Fixed: printing wrong client name in 'SSL_accept failed (timeout)' message - Fixed: ignored 'certificate' and 'key' options from config file - Added: config files for afclient - Modified: some options in afserver config file --- src/realmnames.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/realmnames.c') diff --git a/src/realmnames.c b/src/realmnames.c index 77065bf..be57f8e 100644 --- a/src/realmnames.c +++ b/src/realmnames.c @@ -25,36 +25,36 @@ #include "realmnames.h" char* -get_realmname(ConfigurationT* config, int realm) +get_realmname(ServerConfiguration* config, int realm) { static char realmname[10]; - if (config->realmtable[realm].realmname == NULL) { + if (ServerRealm_get_realmName(ServerConfiguration_get_realmsTable(config)[realm]) == NULL) { memset(realmname, 0, 10); sprintf(realmname, "%d", realm); return realmname; } - return config->realmtable[realm].realmname; + return ServerRealm_get_realmName(ServerConfiguration_get_realmsTable(config)[realm]); } int -get_realmnumber(ConfigurationT* config, char* realmname) +get_realmnumber(ServerConfiguration* config, char* realmname) { int i; char guard; - for (i = 0; i < config->size; ++i) { - if (config->realmtable[i].realmname != NULL) { - if (strcmp(realmname, config->realmtable[i].realmname) == 0) { + for (i = 0; i < ServerConfiguration_get_realmsNumber(config); ++i) { + if (ServerRealm_get_realmName(ServerConfiguration_get_realmsTable(config)[i]) != NULL) { + if (strcmp(realmname, ServerRealm_get_realmName(ServerConfiguration_get_realmsTable(config)[i])) == 0) { return i; } } } if (sscanf(realmname, "%d%c", &i, &guard) == 1) { - if ((i >= 0) && (i < config->size)) { - if (config->realmtable[i].realmname == NULL) { + if ((i >= 0) && (i < ServerConfiguration_get_realmsNumber(config))) { + if (ServerRealm_get_realmName(ServerConfiguration_get_realmsTable(config)[i]) == NULL) { return i; } } -- cgit v1.1