summaryrefslogtreecommitdiff
path: root/src/clientnames.c
diff options
context:
space:
mode:
authorJakub Sławiński2005-11-03 20:37:56 +0100
committerJoshua Judson Rosen2014-07-17 21:15:00 +0200
commit63bbc710b23893742e5ccbd430f95bf2d29c2da6 (patch)
tree06d0585724cff8a4f1a7c052b5b89fd12c404094 /src/clientnames.c
parentv0.7.2 (diff)
downloadapf-63bbc710b23893742e5ccbd430f95bf2d29c2da6.tar.gz
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
Diffstat (limited to 'src/clientnames.c')
-rw-r--r--src/clientnames.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/clientnames.c b/src/clientnames.c
index 4fee9a8..3640ae9 100644
--- a/src/clientnames.c
+++ b/src/clientnames.c
@@ -25,37 +25,37 @@
#include "clientnames.h"
char*
-get_clientname(RealmT* pointer, int client)
+get_clientname(ServerRealm* pointer, int client)
{
static char clientname[10];
- if (ConnectClient_get_sClientId(pointer->clitable[client]) == NULL) {
+ if (ConnectClient_get_sClientId(ServerRealm_get_clientsTable(pointer)[client]) == NULL) {
memset(clientname, 0, 10);
- sprintf(clientname, "%d", ConnectClient_get_clientId(pointer->clitable[client]));
+ sprintf(clientname, "%d", ConnectClient_get_clientId(ServerRealm_get_clientsTable(pointer)[client]));
return clientname;
}
- return ConnectClient_get_sClientId(pointer->clitable[client]);
+ return ConnectClient_get_sClientId(ServerRealm_get_clientsTable(pointer)[client]);
}
int
-get_clientid(RealmT* pointer, char* clientname)
+get_clientid(ServerRealm* pointer, char* clientname)
{
int i, n;
char guard;
- for (i = 0; i < pointer->clinum; ++i) {
- if (ConnectClient_get_sClientId(pointer->clitable[i]) != NULL) {
- if (strcmp(clientname, ConnectClient_get_sClientId(pointer->clitable[i])) == 0) {
- return ConnectClient_get_clientId(pointer->clitable[i]);
+ for (i = 0; i < ServerRealm_get_clientsLimit(pointer); ++i) {
+ if (ConnectClient_get_sClientId(ServerRealm_get_clientsTable(pointer)[i]) != NULL) {
+ if (strcmp(clientname, ConnectClient_get_sClientId(ServerRealm_get_clientsTable(pointer)[i])) == 0) {
+ return ConnectClient_get_clientId(ServerRealm_get_clientsTable(pointer)[i]);
}
}
}
if (sscanf(clientname, "%d%c", &i, &guard) == 1) {
n = get_clientnumber(pointer, i);
- if ((n >= 0) && (n < pointer->clinum)) {
- if (ConnectClient_get_sClientId(pointer->clitable[n]) == NULL) {
+ if ((n >= 0) && (n < ServerRealm_get_clientsLimit(pointer))) {
+ if (ConnectClient_get_sClientId(ServerRealm_get_clientsTable(pointer)[n]) == NULL) {
return i;
}
}
@@ -64,11 +64,11 @@ get_clientid(RealmT* pointer, char* clientname)
}
int
-get_clientnumber(RealmT* pointer, int clientid)
+get_clientnumber(ServerRealm* pointer, int clientid)
{
int i;
- for (i = 0; i < pointer->clinum; ++i) {
- if (ConnectClient_get_clientId(pointer->clitable[i]) == clientid) {
+ for (i = 0; i < ServerRealm_get_clientsLimit(pointer); ++i) {
+ if (ConnectClient_get_clientId(ServerRealm_get_clientsTable(pointer)[i]) == clientid) {
return i;
}
}
@@ -77,37 +77,37 @@ get_clientnumber(RealmT* pointer, int clientid)
}
char*
-get_raclientname(RealmT* pointer, int client)
+get_raclientname(ServerRealm* pointer, int client)
{
static char clientname[10];
- if (ConnectClient_get_sClientId(pointer->raclitable[client]) == NULL) {
+ if (ConnectClient_get_sClientId(ServerRealm_get_raClientsTable(pointer)[client]) == NULL) {
memset(clientname, 0, 10);
- sprintf(clientname, "%d", ConnectClient_get_clientId(pointer->raclitable[client]));
+ sprintf(clientname, "%d", ConnectClient_get_clientId(ServerRealm_get_raClientsTable(pointer)[client]));
return clientname;
}
- return ConnectClient_get_sClientId(pointer->raclitable[client]);
+ return ConnectClient_get_sClientId(ServerRealm_get_raClientsTable(pointer)[client]);
}
int
-get_raclientid(RealmT* pointer, char* clientname)
+get_raclientid(ServerRealm* pointer, char* clientname)
{
int i, n;
char guard;
- for (i = 0; i < pointer->raclinum; ++i) {
- if (ConnectClient_get_sClientId(pointer->raclitable[i]) != NULL) {
- if (strcmp(clientname, ConnectClient_get_sClientId(pointer->raclitable[i])) == 0) {
- return ConnectClient_get_clientId(pointer->raclitable[i]);
+ for (i = 0; i < ServerRealm_get_raClientsLimit(pointer); ++i) {
+ if (ConnectClient_get_sClientId(ServerRealm_get_raClientsTable(pointer)[i]) != NULL) {
+ if (strcmp(clientname, ConnectClient_get_sClientId(ServerRealm_get_raClientsTable(pointer)[i])) == 0) {
+ return ConnectClient_get_clientId(ServerRealm_get_raClientsTable(pointer)[i]);
}
}
}
if (sscanf(clientname, "%d%c", &i, &guard) == 1) {
n = get_raclientnumber(pointer, i);
- if ((n >= 0) && (n < pointer->raclinum)) {
- if (ConnectClient_get_sClientId(pointer->raclitable[n]) == NULL) {
+ if ((n >= 0) && (n < ServerRealm_get_raClientsLimit(pointer))) {
+ if (ConnectClient_get_sClientId(ServerRealm_get_raClientsTable(pointer)[n]) == NULL) {
return i;
}
}
@@ -117,11 +117,11 @@ get_raclientid(RealmT* pointer, char* clientname)
}
int
-get_raclientnumber(RealmT* pointer, int clientid)
+get_raclientnumber(ServerRealm* pointer, int clientid)
{
int i;
- for (i = 0; i < pointer->raclinum; ++i) {
- if (ConnectClient_get_clientId(pointer->raclitable[i]) == clientid) {
+ for (i = 0; i < ServerRealm_get_raClientsLimit(pointer); ++i) {
+ if (ConnectClient_get_clientId(ServerRealm_get_raClientsTable(pointer)[i]) == clientid) {
return i;
}
}