diff options
author | Jakub Sławiński | 2006-02-05 15:14:03 +0100 |
---|---|---|
committer | Joshua Judson Rosen | 2014-07-17 21:15:02 +0200 |
commit | b457fec36399c1f7de093d5e92bb4fa453b79c86 (patch) | |
tree | 2084c9a78d40213015e6f10e3e9e01bc4c0c51f1 /src/usernames.c | |
parent | Update copyright statements. (diff) | |
download | apf-b457fec36399c1f7de093d5e92bb4fa453b79c86.tar.gz |
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
Diffstat (limited to 'src/usernames.c')
-rw-r--r-- | src/usernames.c | 20 |
1 files changed, 20 insertions, 0 deletions
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 <config.h> +#include <assert.h> #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; |