summaryrefslogtreecommitdiff
path: root/daemon/ntlm.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-07-22 16:55:14 +0000
committerStef Walter <stef@memberwebs.com>2004-07-22 16:55:14 +0000
commit6be6d1dd25f2e7f2f1de6c0091e9aeae2ea1918c (patch)
tree1454a6bb0ec09fb6b105171d7aab29a217b30a39 /daemon/ntlm.c
parent166f69df6dd704626c1b09ae60145956435b67e1 (diff)
- Fixed uninitialized memory bug
- Imported updated sock_any and hash code
Diffstat (limited to 'daemon/ntlm.c')
-rw-r--r--daemon/ntlm.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/daemon/ntlm.c b/daemon/ntlm.c
index 37de9e8..031e19d 100644
--- a/daemon/ntlm.c
+++ b/daemon/ntlm.c
@@ -47,8 +47,8 @@ typedef struct ntlm_context
int pending_timeout; /* Timeout for authentication (in seconds) */
/* Context ----------------------------------------------------------- */
- hash_t* pending; /* Pending connections */
- hash_t* established; /* Established connections */
+ hsh_t* pending; /* Pending connections */
+ hsh_t* established; /* Established connections */
}
ntlm_context_t;
@@ -135,7 +135,7 @@ static ntlm_connection_t* getpending(ntlm_context_t* ctx, const void* key)
ha_lock(NULL);
- ret = (ntlm_connection_t*)hash_rem(ctx->pending, key);
+ ret = (ntlm_connection_t*)hsh_rem(ctx->pending, key);
ha_unlock(NULL);
@@ -149,11 +149,11 @@ static int putpending(ntlm_context_t* ctx, const void* key, ntlm_connection_t* c
ASSERT(ctx && key && conn);
ASSERT(conn->handle);
- if(!hash_get(ctx->pending, key))
+ if(!hsh_get(ctx->pending, key))
{
ha_lock(NULL);
- if(!hash_set(ctx->pending, key, (void*)conn))
+ if(!hsh_set(ctx->pending, key, (void*)conn))
{
free_hash_object(NULL, conn);
ha_messagex(LOG_ERR, "out of memory");
@@ -196,7 +196,7 @@ int ntlm_auth_basic(ntlm_context_t* ctx, char* key, const char* header,
/* Check and see if this connection is in the cache */
ha_lock(NULL);
- if(hash_get(ctx->established, basic.key) == NTLM_ESTABLISHED)
+ if(hsh_get(ctx->established, basic.key) == NTLM_ESTABLISHED)
found = 1;
ha_unlock(NULL);
@@ -259,7 +259,7 @@ int ntlm_auth_basic(ntlm_context_t* ctx, char* key, const char* header,
ha_lock(NULL);
/* We put this connection into the successful connections */
- r = hash_set(ctx->established, basic.key, NTLM_ESTABLISHED);
+ r = hsh_set(ctx->established, basic.key, NTLM_ESTABLISHED);
ha_unlock(NULL);
@@ -371,8 +371,8 @@ int ntlm_auth_ntlm(ntlm_context_t* ctx, void* key, const char* header,
{
ha_lock(NULL);
- if(hash_count(ctx->pending) >= ctx->pending_max)
- hash_bump(ctx->pending);
+ if(hsh_count(ctx->pending) >= ctx->pending_max)
+ hsh_bump(ctx->pending);
ha_unlock(NULL);
}
@@ -498,7 +498,7 @@ int ntlm_auth_ntlm(ntlm_context_t* ctx, void* key, const char* header,
ha_lock(NULL);
/* We put this connection into the successful connections */
- r = hash_set(ctx->established, key, NTLM_ESTABLISHED);
+ r = hsh_set(ctx->established, key, NTLM_ESTABLISHED);
ha_unlock(NULL);
@@ -581,7 +581,7 @@ int ntlm_init(ha_context_t* context)
if(context)
{
ntlm_context_t* ctx = (ntlm_context_t*)(context->ctx_data);
- hash_table_calls_t htc;
+ hsh_table_calls_t htc;
ASSERT(ctx);
@@ -605,8 +605,8 @@ int ntlm_init(ha_context_t* context)
ASSERT(!ctx->established);
/* Initialize our tables */
- if(!(ctx->pending = hash_create(NTLM_HASH_KEY_LEN)) ||
- !(ctx->established = hash_create(NTLM_HASH_KEY_LEN)))
+ if(!(ctx->pending = hsh_create(NTLM_HASH_KEY_LEN)) ||
+ !(ctx->established = hsh_create(NTLM_HASH_KEY_LEN)))
{
ha_messagex(LOG_CRIT, "out of memory");
return HA_CRITERROR;
@@ -614,7 +614,7 @@ int ntlm_init(ha_context_t* context)
htc.f_freeval = free_hash_object;
htc.arg = NULL;
- hash_set_table_calls(ctx->pending, &htc);
+ hsh_set_table_calls(ctx->pending, &htc);
ha_messagex(LOG_INFO, "ntlm: initialized handler");
}
@@ -644,10 +644,10 @@ void ntlm_destroy(ha_context_t* context)
ntlm_context_t* ctx = (ntlm_context_t*)(context->ctx_data);
if(ctx->pending)
- hash_free(ctx->pending);
+ hsh_free(ctx->pending);
if(ctx->established)
- hash_free(ctx->established);
+ hsh_free(ctx->established);
ha_messagex(LOG_INFO, "ntlm: uninitialized handler");
}
@@ -686,8 +686,8 @@ int ntlm_process(const ha_request_t* req, ha_response_t* resp)
* authenticated connections which have expired as
* well as half open connections which expire.
*/
- r = hash_purge(ctx->pending, t - ctx->pending_timeout);
- r += hash_purge(ctx->established, t - req->context->cache_timeout);
+ r = hsh_purge(ctx->pending, t - ctx->pending_timeout);
+ r += hsh_purge(ctx->established, t - req->context->cache_timeout);
ha_unlock(NULL);
@@ -739,9 +739,9 @@ int ntlm_process(const ha_request_t* req, ha_response_t* resp)
* allow connections to be re-authenticated.
*/
- if(hash_get(ctx->established, key) == NTLM_ESTABLISHED)
+ if(hsh_get(ctx->established, key) == NTLM_ESTABLISHED)
{
- hash_touch(ctx->established, key);
+ hsh_touch(ctx->established, key);
resp->code = HA_SERVER_OK;
}