From b457fec36399c1f7de093d5e92bb4fa453b79c86 Mon Sep 17 00:00:00 2001 From: Jakub Sławiński Date: Sun, 5 Feb 2006 15:14:03 +0100 Subject: v0.8 - Fixed: infinite loop after buffering message - Fixed: corrupt packets after closing connections in the stopped state - Fixed: bug in mapping user numbers between afclient and afserver - Fixed: premature close of the service connection - Fixed: invalid buffering when the connection is closing - Added: Multiple tunnels in one afclient<->afserver connection --- src/usernames.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/usernames.c') diff --git a/src/usernames.c b/src/usernames.c index 792a1d1..656074a 100644 --- a/src/usernames.c +++ b/src/usernames.c @@ -19,20 +19,40 @@ */ #include +#include #include "usernames.h" +/* + * Function name: get_username + * Description: Returns the id of the user. + * Arguments: pointer - the server realm + * user - the number of the user + * Returns: The id of the user. + */ + int get_username(ServerRealm* pointer, int user) { + assert(pointer != NULL); return ConnectUser_get_userId(ServerRealm_get_usersTable(pointer)[user]); } +/* + * Function name: get_usernumber + * Description: Returns the number of the user. + * Arguments: pointer - the server realm + * user - the id of the user + * Returns: The number of the user. + */ + int get_usernumber(ServerRealm* pointer, int userid) { int i; + assert(pointer != NULL); + for (i = 0; i < ServerRealm_get_usersLimit(pointer); ++i) { if (userid == ConnectUser_get_userId(ServerRealm_get_usersTable(pointer)[i])) { return i; -- cgit v1.1