Commit b047537e authored by Philipp Schafft's avatar Philipp Schafft 🦁

Update: Convert Icecast to use libigloo

parent 341f99be
...@@ -127,14 +127,14 @@ AC_TYPE_UID_T ...@@ -127,14 +127,14 @@ AC_TYPE_UID_T
dnl Checks for required libraries dnl Checks for required libraries
dnl dnl
dnl permafrost dnl igloo
dnl dnl
PKG_CHECK_MODULES([PERMAFROST], [permafrost], [], [ PKG_CHECK_MODULES([IGLOO], [igloo], [], [
AC_MSG_ERROR([${PERMAFROST_PKG_ERRORS}. permafrost is required.]) AC_MSG_ERROR([${IGLOO_PKG_ERRORS}. igloo is required.])
]) ])
CFLAGS="${CFLAGS} ${PERMAFROST_CFLAGS}" CFLAGS="${CFLAGS} ${IGLOO_CFLAGS}"
LIBS="${LIBS} ${PERMAFROST_LIBS}" LIBS="${LIBS} ${IGLOO_LIBS}"
dnl dnl
dnl libxml2 dnl libxml2
......
...@@ -242,14 +242,14 @@ int acl_set_method_str__callback(acl_t *acl, ...@@ -242,14 +242,14 @@ int acl_set_method_str__callback(acl_t *acl,
acl_policy_t policy, acl_policy_t policy,
const char *str) const char *str)
{ {
httpp_request_type_e method; igloo_httpp_request_type_e method;
size_t i; size_t i;
if (strcmp(str, "*") == 0) { if (strcmp(str, "*") == 0) {
for (i = 0; i < (sizeof(acl->method)/sizeof(*acl->method)); i++) for (i = 0; i < (sizeof(acl->method)/sizeof(*acl->method)); i++)
acl->method[i] = policy; acl->method[i] = policy;
} else { } else {
method = httpp_str_to_method(str); method = igloo_httpp_str_to_method(str);
if (method == httpp_req_unknown) if (method == httpp_req_unknown)
return -1; return -1;
...@@ -259,7 +259,7 @@ int acl_set_method_str__callback(acl_t *acl, ...@@ -259,7 +259,7 @@ int acl_set_method_str__callback(acl_t *acl,
return 0; return 0;
} }
acl_policy_t acl_test_method(acl_t * acl, httpp_request_type_e method) acl_policy_t acl_test_method(acl_t * acl, igloo_httpp_request_type_e method)
{ {
if (!acl || method < httpp_req_none || method > httpp_req_unknown) if (!acl || method < httpp_req_none || method > httpp_req_unknown)
return ACL_POLICY_ERROR; return ACL_POLICY_ERROR;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <libxml/xmlmemory.h> #include <libxml/xmlmemory.h>
#include <libxml/parser.h> #include <libxml/parser.h>
#include <libxml/tree.h> #include <libxml/tree.h>
#include <permafrost/httpp.h> #include <igloo/httpp.h>
#include "icecasttypes.h" #include "icecasttypes.h"
#include "cfgfile.h" #include "cfgfile.h"
...@@ -44,7 +44,7 @@ int acl_set_ANY_str(acl_t * acl, acl_policy_t policy, const char * str, int (*ca ...@@ -44,7 +44,7 @@ int acl_set_ANY_str(acl_t * acl, acl_policy_t policy, const char * str, int (*ca
/* HTTP Method specific functions */ /* HTTP Method specific functions */
int acl_set_method_str__callback(acl_t * acl, acl_policy_t policy, const char * str); int acl_set_method_str__callback(acl_t * acl, acl_policy_t policy, const char * str);
#define acl_set_method_str(acl,policy,str) acl_set_ANY_str((acl), (policy), (str), acl_set_method_str__callback) #define acl_set_method_str(acl,policy,str) acl_set_ANY_str((acl), (policy), (str), acl_set_method_str__callback)
acl_policy_t acl_test_method(acl_t * acl, httpp_request_type_e method); acl_policy_t acl_test_method(acl_t * acl, igloo_httpp_request_type_e method);
/* admin/ interface specific functions */ /* admin/ interface specific functions */
int acl_set_admin_str__callbck(acl_t * acl, acl_policy_t policy, const char * str); int acl_set_admin_str__callbck(acl_t * acl, acl_policy_t policy, const char * str);
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
/* Helper macros */ /* Helper macros */
#define COMMAND_REQUIRE(client,name,var) \ #define COMMAND_REQUIRE(client,name,var) \
do { \ do { \
(var) = httpp_get_param((client)->parser, (name)); \ (var) = igloo_httpp_get_param((client)->parser, (name)); \
if((var) == NULL) { \ if((var) == NULL) { \
client_send_error_by_id(client, ICECAST_ERROR_ADMIN_MISSING_PARAMETER); \ client_send_error_by_id(client, ICECAST_ERROR_ADMIN_MISSING_PARAMETER); \
return; \ return; \
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
} while(0); } while(0);
#define COMMAND_OPTIONAL(client,name,var) \ #define COMMAND_OPTIONAL(client,name,var) \
(var) = httpp_get_param((client)->parser, (name)) (var) = igloo_httpp_get_param((client)->parser, (name))
#define FALLBACK_RAW_REQUEST "fallbacks" #define FALLBACK_RAW_REQUEST "fallbacks"
#define FALLBACK_HTML_REQUEST "fallbacks.xsl" #define FALLBACK_HTML_REQUEST "fallbacks.xsl"
...@@ -329,7 +329,7 @@ xmlNodePtr admin_build_rootnode(xmlDocPtr doc, const char *name) ...@@ -329,7 +329,7 @@ xmlNodePtr admin_build_rootnode(xmlDocPtr doc, const char *name)
* doc even if the source is running */ * doc even if the source is running */
xmlDocPtr admin_build_sourcelist(const char *mount) xmlDocPtr admin_build_sourcelist(const char *mount)
{ {
avl_node *node; igloo_avl_node *node;
source_t *source; source_t *source;
xmlNodePtr xmlnode, srcnode; xmlNodePtr xmlnode, srcnode;
xmlDocPtr doc; xmlDocPtr doc;
...@@ -344,12 +344,12 @@ xmlDocPtr admin_build_sourcelist(const char *mount) ...@@ -344,12 +344,12 @@ xmlDocPtr admin_build_sourcelist(const char *mount)
xmlNewTextChild (xmlnode, NULL, XMLSTR("current_source"), XMLSTR(mount)); xmlNewTextChild (xmlnode, NULL, XMLSTR("current_source"), XMLSTR(mount));
} }
node = avl_get_first(global.source_tree); node = igloo_avl_get_first(global.source_tree);
while(node) { while(node) {
source = (source_t *)node->key; source = (source_t *)node->key;
if (mount && strcmp (mount, source->mount) == 0) if (mount && strcmp (mount, source->mount) == 0)
{ {
node = avl_get_next (node); node = igloo_avl_get_next (node);
continue; continue;
} }
...@@ -390,7 +390,7 @@ xmlDocPtr admin_build_sourcelist(const char *mount) ...@@ -390,7 +390,7 @@ xmlDocPtr admin_build_sourcelist(const char *mount)
XMLSTR(source->format->contenttype)); XMLSTR(source->format->contenttype));
} }
} }
node = avl_get_next(node); node = igloo_avl_get_next(node);
} }
return(doc); return(doc);
} }
...@@ -516,19 +516,19 @@ void admin_handle_request(client_t *client, const char *uri) ...@@ -516,19 +516,19 @@ void admin_handle_request(client_t *client, const char *uri)
if(mount != NULL) { if(mount != NULL) {
/* This is a mount request, handle it as such */ /* This is a mount request, handle it as such */
avl_tree_rlock(global.source_tree); igloo_avl_tree_rlock(global.source_tree);
source = source_find_mount_raw(mount); source = source_find_mount_raw(mount);
/* No Source found */ /* No Source found */
if (source == NULL) { if (source == NULL) {
avl_tree_unlock(global.source_tree); igloo_avl_tree_unlock(global.source_tree);
ICECAST_LOG_WARN("Admin command \"%H\" on non-existent source \"%H\"", ICECAST_LOG_WARN("Admin command \"%H\" on non-existent source \"%H\"",
uri, mount); uri, mount);
client_send_error_by_id(client, ICECAST_ERROR_ADMIN_SOURCE_DOES_NOT_EXIST); client_send_error_by_id(client, ICECAST_ERROR_ADMIN_SOURCE_DOES_NOT_EXIST);
return; return;
} /* No Source running */ } /* No Source running */
else if (source->running == 0 && source->on_demand == 0) { else if (source->running == 0 && source->on_demand == 0) {
avl_tree_unlock(global.source_tree); igloo_avl_tree_unlock(global.source_tree);
ICECAST_LOG_INFO("Received admin command \"%H\" on unavailable mount \"%H\"", ICECAST_LOG_INFO("Received admin command \"%H\" on unavailable mount \"%H\"",
uri, mount); uri, mount);
client_send_error_by_id(client, ICECAST_ERROR_ADMIN_SOURCE_IS_NOT_AVAILABLE); client_send_error_by_id(client, ICECAST_ERROR_ADMIN_SOURCE_IS_NOT_AVAILABLE);
...@@ -582,7 +582,7 @@ void admin_handle_request(client_t *client, const char *uri) ...@@ -582,7 +582,7 @@ void admin_handle_request(client_t *client, const char *uri)
} }
if (source) { if (source) {
avl_tree_unlock(global.source_tree); igloo_avl_tree_unlock(global.source_tree);
} }
return; return;
} }
...@@ -695,15 +695,15 @@ static inline xmlNodePtr __add_listener(client_t *client, ...@@ -695,15 +695,15 @@ static inline xmlNodePtr __add_listener(client_t *client,
xmlNewTextChild(node, NULL, XMLSTR(mode == OMODE_LEGACY ? "IP" : "ip"), XMLSTR(client->con->ip)); xmlNewTextChild(node, NULL, XMLSTR(mode == OMODE_LEGACY ? "IP" : "ip"), XMLSTR(client->con->ip));
tmp = httpp_getvar(client->parser, "user-agent"); tmp = igloo_httpp_getvar(client->parser, "user-agent");
if (tmp) if (tmp)
xmlNewTextChild(node, NULL, XMLSTR(mode == OMODE_LEGACY ? "UserAgent" : "useragent"), XMLSTR(tmp)); xmlNewTextChild(node, NULL, XMLSTR(mode == OMODE_LEGACY ? "UserAgent" : "useragent"), XMLSTR(tmp));
tmp = httpp_getvar(client->parser, "referer"); tmp = igloo_httpp_getvar(client->parser, "referer");
if (tmp) if (tmp)
xmlNewTextChild(node, NULL, XMLSTR("referer"), XMLSTR(tmp)); xmlNewTextChild(node, NULL, XMLSTR("referer"), XMLSTR(tmp));
tmp = httpp_getvar(client->parser, "host"); tmp = igloo_httpp_getvar(client->parser, "host");
if (tmp) if (tmp)
xmlNewTextChild(node, NULL, XMLSTR("host"), XMLSTR(tmp)); xmlNewTextChild(node, NULL, XMLSTR("host"), XMLSTR(tmp));
...@@ -735,15 +735,15 @@ void admin_add_listeners_to_mount(source_t *source, ...@@ -735,15 +735,15 @@ void admin_add_listeners_to_mount(source_t *source,
operation_mode mode) operation_mode mode)
{ {
time_t now = time(NULL); time_t now = time(NULL);
avl_node *client_node; igloo_avl_node *client_node;
avl_tree_rlock(source->client_tree); igloo_avl_tree_rlock(source->client_tree);
client_node = avl_get_first(source->client_tree); client_node = igloo_avl_get_first(source->client_tree);
while(client_node) { while(client_node) {
__add_listener((client_t *)client_node->key, parent, now, mode); __add_listener((client_t *)client_node->key, parent, now, mode);
client_node = avl_get_next(client_node); client_node = igloo_avl_get_next(client_node);
} }
avl_tree_unlock(source->client_tree); igloo_avl_tree_unlock(source->client_tree);
} }
static void command_show_listeners(client_t *client, static void command_show_listeners(client_t *client,
...@@ -1200,9 +1200,9 @@ static void command_list_mounts(client_t *client, source_t *source, admin_format ...@@ -1200,9 +1200,9 @@ static void command_list_mounts(client_t *client, source_t *source, admin_format
fserve_add_client (client, NULL); fserve_add_client (client, NULL);
} else { } else {
xmlDocPtr doc; xmlDocPtr doc;
avl_tree_rlock(global.source_tree); igloo_avl_tree_rlock(global.source_tree);
doc = admin_build_sourcelist(NULL); doc = admin_build_sourcelist(NULL);
avl_tree_unlock(global.source_tree); igloo_avl_tree_unlock(global.source_tree);
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
LISTMOUNTS_HTML_REQUEST); LISTMOUNTS_HTML_REQUEST);
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <permafrost/httpp.h> #include <igloo/httpp.h>
#include "auth.h" #include "auth.h"
#include "source.h" #include "source.h"
...@@ -43,14 +43,14 @@ ...@@ -43,14 +43,14 @@
struct auth_stack_tag { struct auth_stack_tag {
size_t refcount; size_t refcount;
auth_t *auth; auth_t *auth;
mutex_t lock; igloo_mutex_t lock;
auth_stack_t *next; auth_stack_t *next;
}; };
/* code */ /* code */
static void __handle_auth_client(auth_t *auth, auth_client *auth_user); static void __handle_auth_client(auth_t *auth, auth_client *auth_user);
static mutex_t _auth_lock; /* protects _current_id */ static igloo_mutex_t _auth_lock; /* protects _current_id */
static volatile unsigned long _current_id = 0; static volatile unsigned long _current_id = 0;
static unsigned long _next_auth_id(void) { static unsigned long _next_auth_id(void) {
...@@ -116,7 +116,7 @@ static auth_client *auth_client_setup (client_t *client) ...@@ -116,7 +116,7 @@ static auth_client *auth_client_setup (client_t *client)
if (client->username || client->password) if (client->username || client->password)
break; break;
header = httpp_getvar(client->parser, "authorization"); header = igloo_httpp_getvar(client->parser, "authorization");
if (header == NULL) if (header == NULL)
break; break;
...@@ -201,7 +201,7 @@ void auth_release (auth_t *authenticator) { ...@@ -201,7 +201,7 @@ void auth_release (auth_t *authenticator) {
if (authenticator->running) { if (authenticator->running) {
authenticator->running = 0; authenticator->running = 0;
thread_mutex_unlock(&authenticator->lock); thread_mutex_unlock(&authenticator->lock);
thread_join(authenticator->thread); igloo_thread_join(authenticator->thread);
thread_mutex_lock(&authenticator->lock); thread_mutex_lock(&authenticator->lock);
} }
...@@ -214,7 +214,7 @@ void auth_release (auth_t *authenticator) { ...@@ -214,7 +214,7 @@ void auth_release (auth_t *authenticator) {
if (authenticator->management_url) if (authenticator->management_url)
xmlFree (authenticator->management_url); xmlFree (authenticator->management_url);
thread_mutex_unlock(&authenticator->lock); thread_mutex_unlock(&authenticator->lock);
thread_mutex_destroy(&authenticator->lock); igloo_thread_mutex_destroy(&authenticator->lock);
if (authenticator->mount) if (authenticator->mount)
free(authenticator->mount); free(authenticator->mount);
acl_release(authenticator->acl); acl_release(authenticator->acl);
...@@ -252,11 +252,11 @@ static void auth_client_free (auth_client *auth_user) ...@@ -252,11 +252,11 @@ static void auth_client_free (auth_client *auth_user)
/* verify that the client is still connected. */ /* verify that the client is still connected. */
static int is_client_connected (client_t *client) { static int is_client_connected (client_t *client) {
/* As long as sock_active() is broken we need to disable this: /* As long as igloo_sock_active() is broken we need to disable this:
int ret = 1; int ret = 1;
if (client) if (client)
if (sock_active(client->con->sock) == 0) if (igloo_sock_active(client->con->sock) == 0)
ret = 0; ret = 0;
return ret; return ret;
*/ */
...@@ -433,7 +433,7 @@ static void *auth_run_thread (void *arg) ...@@ -433,7 +433,7 @@ static void *auth_run_thread (void *arg)
} else { } else {
thread_mutex_unlock(&auth->lock); thread_mutex_unlock(&auth->lock);
} }
thread_sleep (150000); igloo_thread_sleep (150000);
} }
ICECAST_LOG_INFO("Authentication thread shutting down"); ICECAST_LOG_INFO("Authentication thread shutting down");
return NULL; return NULL;
...@@ -715,7 +715,7 @@ static inline int auth_get_authenticator__filter_method(auth_t *auth, xmlNodePtr ...@@ -715,7 +715,7 @@ static inline int auth_get_authenticator__filter_method(auth_t *auth, xmlNodePtr
while (cur) { while (cur) {
char *next = strstr(cur, ","); char *next = strstr(cur, ",");
httpp_request_type_e idx; igloo_httpp_request_type_e idx;
if (next) { if (next) {
*next = 0; *next = 0;
...@@ -731,7 +731,7 @@ static inline int auth_get_authenticator__filter_method(auth_t *auth, xmlNodePtr ...@@ -731,7 +731,7 @@ static inline int auth_get_authenticator__filter_method(auth_t *auth, xmlNodePtr
break; break;
} }
idx = httpp_str_to_method(cur); idx = igloo_httpp_str_to_method(cur);
if (idx == httpp_req_unknown) { if (idx == httpp_req_unknown) {
ICECAST_LOG_ERROR("Can not add known method \"%H\" to role's %s", cur, name); ICECAST_LOG_ERROR("Can not add known method \"%H\" to role's %s", cur, name);
return -1; return -1;
...@@ -838,7 +838,7 @@ auth_t *auth_get_authenticator(xmlNodePtr node) ...@@ -838,7 +838,7 @@ auth_t *auth_get_authenticator(xmlNodePtr node)
method_inited = 1; method_inited = 1;
while (cur) { while (cur) {
httpp_request_type_e idx; igloo_httpp_request_type_e idx;
next = strstr(cur, ","); next = strstr(cur, ",");
if (next) { if (next) {
...@@ -853,7 +853,7 @@ auth_t *auth_get_authenticator(xmlNodePtr node) ...@@ -853,7 +853,7 @@ auth_t *auth_get_authenticator(xmlNodePtr node)
break; break;
} }
idx = httpp_str_to_method(cur); idx = igloo_httpp_str_to_method(cur);
if (idx == httpp_req_unknown) { if (idx == httpp_req_unknown) {
auth_release(auth); auth_release(auth);
return NULL; return NULL;
...@@ -953,7 +953,7 @@ auth_t *auth_get_authenticator(xmlNodePtr node) ...@@ -953,7 +953,7 @@ auth_t *auth_get_authenticator(xmlNodePtr node)
auth->tailp = &auth->head; auth->tailp = &auth->head;
if (!auth->immediate) { if (!auth->immediate) {
auth->running = 1; auth->running = 1;
auth->thread = thread_create("auth thread", auth_run_thread, auth, THREAD_ATTACHED); auth->thread = thread_create("auth thread", auth_run_thread, auth, igloo_THREAD_ATTACHED);
} }
} }
} }
...@@ -1028,7 +1028,7 @@ void auth_initialise (void) ...@@ -1028,7 +1028,7 @@ void auth_initialise (void)
void auth_shutdown (void) void auth_shutdown (void)
{ {
ICECAST_LOG_INFO("Auth shutdown"); ICECAST_LOG_INFO("Auth shutdown");
thread_mutex_destroy(&_auth_lock); igloo_thread_mutex_destroy(&_auth_lock);
} }
/* authstack functions */ /* authstack functions */
...@@ -1070,7 +1070,7 @@ void auth_stack_release(auth_stack_t *stack) { ...@@ -1070,7 +1070,7 @@ void auth_stack_release(auth_stack_t *stack) {
auth_release(stack->auth); auth_release(stack->auth);
auth_stack_release(stack->next); auth_stack_release(stack->next);
thread_mutex_destroy(&stack->lock); igloo_thread_mutex_destroy(&stack->lock);
free(stack); free(stack);
} }
...@@ -1186,7 +1186,7 @@ auth_t *auth_stack_getbyid(auth_stack_t *stack, unsigned long id) { ...@@ -1186,7 +1186,7 @@ auth_t *auth_stack_getbyid(auth_stack_t *stack, unsigned long id) {
} }
acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack, httpp_request_type_e method) { acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack, igloo_httpp_request_type_e method) {
acl_t *ret = NULL; acl_t *ret = NULL;
if (!stack || method < 0 || method > httpp_req_unknown) if (!stack || method < 0 || method > httpp_req_unknown)
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include <libxml/parser.h> #include <libxml/parser.h>
#include <libxml/tree.h> #include <libxml/tree.h>
#include <permafrost/thread.h> #include <igloo/thread.h>
#include <permafrost/httpp.h> #include <igloo/httpp.h>
#include "icecasttypes.h" #include "icecasttypes.h"
#include "cfgfile.h" #include "cfgfile.h"
...@@ -142,11 +142,11 @@ struct auth_tag ...@@ -142,11 +142,11 @@ struct auth_tag
auth_result (*deleteuser)(auth_t *auth, const char *username); auth_result (*deleteuser)(auth_t *auth, const char *username);
auth_result (*listuser)(auth_t *auth, xmlNodePtr srcnode); auth_result (*listuser)(auth_t *auth, xmlNodePtr srcnode);
mutex_t lock; igloo_mutex_t lock;
int running; int running;
size_t refcount; size_t refcount;
thread_type *thread; igloo_thread_type *thread;
/* per-auth queue for clients */ /* per-auth queue for clients */
auth_client *head, **tailp; auth_client *head, **tailp;
...@@ -200,6 +200,6 @@ int auth_stack_push(auth_stack_t **stack, auth_t *auth); ...@@ -200,6 +200,6 @@ int auth_stack_push(auth_stack_t **stack, auth_t *auth);
int auth_stack_append(auth_stack_t *stack, auth_stack_t *tail); int auth_stack_append(auth_stack_t *stack, auth_stack_t *tail);
auth_t *auth_stack_get(auth_stack_t *stack); auth_t *auth_stack_get(auth_stack_t *stack);
auth_t *auth_stack_getbyid(auth_stack_t *stack, unsigned long id); auth_t *auth_stack_getbyid(auth_stack_t *stack, unsigned long id);
acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack, httpp_request_type_e method); acl_t *auth_stack_get_anonymous_acl(auth_stack_t *stack, igloo_httpp_request_type_e method);
#endif #endif
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <permafrost/httpp.h> #include <igloo/httpp.h>
#include "auth.h" #include "auth.h"
#include "source.h" #include "source.h"
...@@ -53,8 +53,8 @@ typedef struct { ...@@ -53,8 +53,8 @@ typedef struct {
typedef struct { typedef struct {
char *filename; char *filename;
rwlock_t file_rwlock; igloo_rwlock_t file_rwlock;
avl_tree *users; igloo_avl_tree *users;
time_t mtime; time_t mtime;
} htpasswd_auth_state; } htpasswd_auth_state;
...@@ -63,8 +63,8 @@ static void htpasswd_clear(auth_t *self) ...@@ -63,8 +63,8 @@ static void htpasswd_clear(auth_t *self)
htpasswd_auth_state *state = self->state; htpasswd_auth_state *state = self->state;
free(state->filename); free(state->filename);
if (state->users) if (state->users)
avl_tree_free (state->users, _free_user); igloo_avl_tree_free (state->users, _free_user);
thread_rwlock_destroy(&state->file_rwlock); igloo_thread_rwlock_destroy(&state->file_rwlock);
free(state); free(state);
} }
...@@ -109,7 +109,7 @@ static int _free_user(void *key) ...@@ -109,7 +109,7 @@ static int _free_user(void *key)
static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd) static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd)
{ {
FILE *passwdfile; FILE *passwdfile;
avl_tree *new_users; igloo_avl_tree *new_users;
int num = 0; int num = 0;
struct stat file_stat; struct stat file_stat;
char *sep; char *sep;
...@@ -123,7 +123,7 @@ static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd) ...@@ -123,7 +123,7 @@ static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd)
/* Create a dummy users tree for things to use later */ /* Create a dummy users tree for things to use later */
thread_rwlock_wlock (&htpasswd->file_rwlock); thread_rwlock_wlock (&htpasswd->file_rwlock);
if(!htpasswd->users) if(!htpasswd->users)
htpasswd->users = avl_tree_new(compare_users, NULL); htpasswd->users = igloo_avl_tree_new(compare_users, NULL);
thread_rwlock_unlock (&htpasswd->file_rwlock); thread_rwlock_unlock (&htpasswd->file_rwlock);
return; return;
...@@ -142,7 +142,7 @@ static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd) ...@@ -142,7 +142,7 @@ static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd)
} }
htpasswd->mtime = file_stat.st_mtime; htpasswd->mtime = file_stat.st_mtime;
new_users = avl_tree_new (compare_users, NULL); new_users = igloo_avl_tree_new (compare_users, NULL);
while (get_line(passwdfile, line, MAX_LINE_LEN)) { while (get_line(passwdfile, line, MAX_LINE_LEN)) {
int len; int len;
...@@ -163,13 +163,13 @@ static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd) ...@@ -163,13 +163,13 @@ static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd)
*sep = 0; *sep = 0;