diff options
Diffstat (limited to 'src/Authorisation.c')
-rw-r--r-- | src/Authorisation.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/Authorisation.c b/src/Authorisation.c index b3e048d..3cde03d 100644 --- a/src/Authorisation.c +++ b/src/Authorisation.c @@ -22,7 +22,7 @@ #include <crypt.h> #endif -#include "util_Hash.h" +#include "httpd_Map.h" #include "util_String.h" #include "httpRequest.h" @@ -49,7 +49,7 @@ struct httpUserData ********************* Local Routine Prototypes ********************* ********************************************************************/ -static int AddUser(uHash *database, +static int AddUser(uMap database, const char *name, const char *password, const char *encryption_scheme); @@ -66,7 +66,7 @@ static int VerifyPassword(const char *database, ********************* Local Data ***************************** ********************************************************************/ -static uHash *AuthDatabase = NULL; +static uMap AuthDatabase = NULL; #define INITIAL_SIZE 32 #define DECODED_SIZE 100 @@ -95,26 +95,26 @@ int HTTP_AuthAddUser(const char *database, const char *encryption_scheme) { int retcode = -1; - uHash *this_database = NULL; + uMap this_database = NULL; /* Create the master database if necessary */ if(!AuthDatabase) { - AuthDatabase = Util_HashCreate(INITIAL_SIZE); + AuthDatabase = Httpd_MapCreate(); } if(AuthDatabase) { /* Does this database exist ? */ - this_database = (uHash *)Util_HashData(AuthDatabase, strlen(database), database, 0); + this_database = (uMap)Httpd_MapData(AuthDatabase, strlen(database), database); if(!this_database) { - this_database = Util_HashCreate(INITIAL_SIZE); + this_database = Httpd_MapCreate(); if(this_database) { - Util_HashStore(AuthDatabase, strlen(database), database, 0, (void *)this_database); + Httpd_MapStore(AuthDatabase, strlen(database), database, (void *)this_database); } else { @@ -254,7 +254,7 @@ int HTTP_AuthenticateBasic(httpRequest *request, @endhistory @@*/ -static int AddUser(uHash *database, +static int AddUser(uMap database, const char *name, const char *password, const char *encryption_scheme) @@ -262,8 +262,8 @@ static int AddUser(uHash *database, int retcode = -1; /* Does this user already exist ? */ - struct httpUserData * this_user = (struct httpUserData *)Util_HashData( - database, strlen(name), name, 0); + struct httpUserData * this_user = (struct httpUserData *)Httpd_MapData( + database, strlen(name), name); if(!this_user) { @@ -276,7 +276,7 @@ static int AddUser(uHash *database, this_user->password = Util_Strdup(password); this_user->encryption_scheme = Util_Strdup(encryption_scheme); - retcode = Util_HashStore(database, strlen(name), name, 0, (void *)this_user); + retcode = Httpd_MapStore(database, strlen(name), name, (void *)this_user); } } else @@ -317,13 +317,13 @@ static int VerifyPassword(const char *database, if(AuthDatabase) { /* Does this database exist ? */ - uHash *this_database = (uHash *)Util_HashData(AuthDatabase, - strlen(database), database, 0); + uMap this_database = (uMap)Httpd_MapData(AuthDatabase, + strlen(database), database); if(this_database) { - struct httpUserData *data = (struct httpUserData *) Util_HashData( - this_database, strlen(user), user, 0); + struct httpUserData *data = (struct httpUserData *) Httpd_MapData( + this_database, strlen(user), user); if(data) { |