diff options
Diffstat (limited to 'src/Server.c')
-rw-r--r-- | src/Server.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Server.c b/src/Server.c index 5959c9c..0aee562 100644 --- a/src/Server.c +++ b/src/Server.c @@ -15,7 +15,7 @@ #include "cctk_Parameters.h" -#include "util_Hash.h" +#include "httpd_Map.h" #include "util_String.h" #include "httpd.h" @@ -61,7 +61,7 @@ static double evaluator(const char *name, void *data); ********************* Local Data ***************************** ********************************************************************/ -static uHash *pages = NULL; +static uMap pages = NULL; static const char *notfound_page = "<html>\n<head>\n<title>Error 404: Not Found</title>\n</head>\n" @@ -164,10 +164,10 @@ int HTTP_RegisterPage(const char *path, int (*function)(const cGH *, httpRequest /* Create the hash table if it's not already been created */ if(! pages) { - pages = Util_HashCreate(INITIAL_SIZE); + pages = Httpd_MapCreate(); } - if(Util_HashData(pages, strlen(path), path, 0)) + if(Httpd_MapData(pages, strlen(path), path)) { CCTK_VWarn(1, __LINE__,__FILE__,CCTK_THORNSTRING, "Page exists already:\n\"%s\"", path); @@ -178,7 +178,7 @@ int HTTP_RegisterPage(const char *path, int (*function)(const cGH *, httpRequest if(pagedata) { - retval = Util_HashStore(pages, strlen(path), path, 0, (void *)pagedata); + retval = Httpd_MapStore(pages, strlen(path), path, (void *)pagedata); } else { @@ -355,9 +355,9 @@ static httpPage *FindPage(const char *path, const char **residual) SetToCString( temp, path); ConcatCString( temp,"index.html"); - pagedata = Util_HashData(pages, Length(temp), GetBuffer(temp), 0); + pagedata = Httpd_MapData(pages, Length(temp), GetBuffer(temp)); } - else if((pagedata = Util_HashData(pages, strlen(path), path, 0))) + else if((pagedata = Httpd_MapData(pages, strlen(path), path))) { /* Or exact path */ } @@ -369,7 +369,7 @@ static httpPage *FindPage(const char *path, const char **residual) SetToCString( temp, path); ConcatCString( temp,"/index.html"); - pagedata = Util_HashData(pages, Length(temp), GetBuffer(temp), 0); + pagedata = Httpd_MapData(pages, Length(temp), GetBuffer(temp)); } *residual = NULL; @@ -385,7 +385,7 @@ static httpPage *FindPage(const char *path, const char **residual) #ifdef HTTP_DEBUG printf("Looking for '%s' less '%s' \n", path, position); #endif - if((pagedata = Util_HashData(pages, position-path, path, 0))) + if((pagedata = Httpd_MapData(pages, position-path, path))) { *residual = position+1; break; |