aboutsummaryrefslogtreecommitdiff
path: root/src/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http.c')
-rw-r--r--src/http.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/http.c b/src/http.c
index 91fffa0..2f08209 100644
--- a/src/http.c
+++ b/src/http.c
@@ -32,7 +32,7 @@
#include "util_String.h"
#include "httpd.h"
-#include "util_Hash.h"
+#include "httpd_Map.h"
#include "SString_Namespace.h"
static const char *rcsid = "$Header$";
@@ -78,12 +78,12 @@ typedef struct httpRequestTag
void *connection;
/* The request header lines */
- uHash *headers;
+ uMap headers;
/* Stuff for arguments */
/* First a hash table to look the data up quickly */
- uHash *arguments;
+ uMap arguments;
/* Now a linked list to allow walking. */
httpArg *firstarg;
@@ -327,7 +327,7 @@ const char *HTTP_ArgumentValue(const httpRequest *request, const char *arg)
{
if(request->arguments)
{
- const httpArg *value = (httpArg *)Util_HashData(request->arguments, strlen(arg), arg, 0);
+ const httpArg *value = (httpArg *)Httpd_MapData(request->arguments, strlen(arg), arg);
if(value)
{
@@ -386,7 +386,7 @@ const char *HTTP_HeaderValue(const httpRequest *request, const char *header)
if(request->headers)
{
- header_line = Util_HashData(request->headers, strlen(header), header, 0);
+ header_line = Httpd_MapData(request->headers, strlen(header), header);
if(header_line)
{
@@ -637,13 +637,13 @@ static int AddHeader(httpRequest *request, const char *line)
if(!request->headers)
{
/* Need to create the hash table */
- request->headers = Util_HashCreate(INITIAL_SIZE);
+ request->headers = Httpd_MapCreate();
}
if(request->headers)
{
/* Does the line already exist ? */
- header_line = (struct httpHeader *)Util_HashData(request->headers, keylength, line, 0);
+ header_line = (struct httpHeader *)Httpd_MapData(request->headers, keylength, line);
if(header_line)
{
@@ -672,7 +672,7 @@ static int AddHeader(httpRequest *request, const char *line)
{
strcpy(header_line->line, value);
- Util_HashStore(request->headers, keylength, line, 0, (void *)header_line);
+ Httpd_MapStore(request->headers, keylength, line, (void *)header_line);
}
}
}
@@ -708,7 +708,7 @@ static int StripArgs(httpRequest *request, char *request_uri)
*position = 0;
/* Create the hash table */
- request->arguments = Util_HashCreate(INITIAL_SIZE);
+ request->arguments = Httpd_MapCreate();
/* Parse the argument list */
position++;
@@ -743,7 +743,7 @@ static int StripArgs(httpRequest *request, char *request_uri)
argument->arg = Util_Strdup(token);
argument->value = Util_Strdup(value);
- if((stored = (httpArg *)Util_HashData(request->arguments, strlen(token), token, 0)))
+ if((stored = (httpArg *)Httpd_MapData(request->arguments, strlen(token), token)))
{
/* Argument already exists */
@@ -759,7 +759,7 @@ static int StripArgs(httpRequest *request, char *request_uri)
}
else
{
- Util_HashStore(request->arguments, strlen(token), token, 0, (void *)argument);
+ Httpd_MapStore(request->arguments, strlen(token), token, (void *)argument);
request->n_arguments++;
}
/* Append to global list. */
@@ -857,12 +857,12 @@ static int ClearRequest(httpRequest *request)
{
if(request->arguments)
{
- Util_HashDestroy(request->arguments, (void (*)(void *))DestroyArgument);
+ Httpd_MapDestroy(request->arguments, (void (*)(void *))DestroyArgument);
}
if(request->headers)
{
- Util_HashDestroy(request->headers, (void (*)(void *))DestroyHeader);
+ Httpd_MapDestroy(request->headers, (void (*)(void *))DestroyHeader);
}
return 0;