Commit 2474c22f authored by Philipp Schafft's avatar Philipp Schafft 🦁

Update: Convert Icecast to use libigloo

parent 19baa93e
Pipeline #475 failed with stage
in 17 seconds
......@@ -127,14 +127,14 @@ AC_TYPE_UID_T
dnl Checks for required libraries
dnl
dnl permafrost
dnl igloo
dnl
PKG_CHECK_MODULES([PERMAFROST], [permafrost], [], [
AC_MSG_ERROR([${PERMAFROST_PKG_ERRORS}. permafrost is required.])
PKG_CHECK_MODULES([IGLOO], [igloo], [], [
AC_MSG_ERROR([${IGLOO_PKG_ERRORS}. igloo is required.])
])
CFLAGS="${CFLAGS} ${PERMAFROST_CFLAGS}"
LIBS="${LIBS} ${PERMAFROST_LIBS}"
CFLAGS="${CFLAGS} ${IGLOO_CFLAGS}"
LIBS="${LIBS} ${IGLOO_LIBS}"
dnl
dnl libxml2
......
......@@ -223,14 +223,14 @@ int acl_set_method_str__callback(acl_t *acl,
acl_policy_t policy,
const char *str)
{
httpp_request_type_e method;
igloo_httpp_request_type_e method;
size_t i;
if (strcmp(str, "*") == 0) {
for (i = 0; i < (sizeof(acl->method)/sizeof(*acl->method)); i++)
acl->method[i] = policy;
} else {
method = httpp_str_to_method(str);
method = igloo_httpp_str_to_method(str);
if (method == httpp_req_unknown)
return -1;
......@@ -240,7 +240,7 @@ int acl_set_method_str__callback(acl_t *acl,
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)
return ACL_POLICY_ERROR;
......
......@@ -16,7 +16,7 @@
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <permafrost/httpp.h>
#include <igloo/httpp.h>
#include "icecasttypes.h"
......@@ -43,7 +43,7 @@ int acl_set_ANY_str(acl_t * acl, acl_policy_t policy, const char * str, int (*ca
/* HTTP Method specific functions */
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)
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 */
int acl_set_admin_str__callbck(acl_t * acl, acl_policy_t policy, const char * str);
......
......@@ -52,7 +52,7 @@
/* Helper macros */
#define COMMAND_REQUIRE(client,name,var) \
do { \
(var) = httpp_get_param((client)->parser, (name)); \
(var) = igloo_httpp_get_param((client)->parser, (name)); \
if((var) == NULL) { \
client_send_error_by_id(client, ICECAST_ERROR_ADMIN_MISSING_PARAMETER); \
return; \
......@@ -60,7 +60,7 @@
} while(0);
#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_HTML_REQUEST "fallbacks.xsl"
......@@ -329,7 +329,7 @@ xmlNodePtr admin_build_rootnode(xmlDocPtr doc, const char *name)
* doc even if the source is running */
xmlDocPtr admin_build_sourcelist(const char *mount)
{
avl_node *node;
igloo_avl_node *node;
source_t *source;
xmlNodePtr xmlnode, srcnode;
xmlDocPtr doc;
......@@ -344,12 +344,12 @@ xmlDocPtr admin_build_sourcelist(const char *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) {
source = (source_t *)node->key;
if (mount && strcmp (mount, source->mount) == 0)
{
node = avl_get_next (node);
node = igloo_avl_get_next (node);
continue;
}
......@@ -390,7 +390,7 @@ xmlDocPtr admin_build_sourcelist(const char *mount)
XMLSTR(source->format->contenttype));
}
}
node = avl_get_next(node);
node = igloo_avl_get_next(node);
}
return(doc);
}
......@@ -516,19 +516,19 @@ void admin_handle_request(client_t *client, const char *uri)
if(mount != NULL) {
/* 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);
/* No Source found */
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\"",
uri, mount);
client_send_error_by_id(client, ICECAST_ERROR_ADMIN_SOURCE_DOES_NOT_EXIST);
return;
} /* No Source running */
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\"",
uri, mount);
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)
}
if (source) {
avl_tree_unlock(global.source_tree);
igloo_avl_tree_unlock(global.source_tree);
}
return;
}
......@@ -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));
tmp = httpp_getvar(client->parser, "user-agent");
tmp = igloo_httpp_getvar(client->parser, "user-agent");
if (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)
xmlNewTextChild(node, NULL, XMLSTR("referer"), XMLSTR(tmp));
tmp = httpp_getvar(client->parser, "host");
tmp = igloo_httpp_getvar(client->parser, "host");
if (tmp)
xmlNewTextChild(node, NULL, XMLSTR("host"), XMLSTR(tmp));
......@@ -735,15 +735,15 @@ void admin_add_listeners_to_mount(source_t *source,
operation_mode mode)
{
time_t now = time(NULL);
avl_node *client_node;
igloo_avl_node *client_node;
avl_tree_rlock(source->client_tree);
client_node = avl_get_first(source->client_tree);
igloo_avl_tree_rlock(source->client_tree);
client_node = igloo_avl_get_first(source->client_tree);
while(client_node) {
__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,
......@@ -1200,9 +1200,9 @@ static void command_list_mounts(client_t *client, source_t *source, admin_format
fserve_add_client (client, NULL);
} else {
xmlDocPtr doc;
avl_tree_rlock(global.source_tree);
igloo_avl_tree_rlock(global.source_tree);
doc = admin_build_sourcelist(NULL);
avl_tree_unlock(global.source_tree);
igloo_avl_tree_unlock(global.source_tree);
admin_send_response(doc, client, response,
LISTMOUNTS_HTML_REQUEST);
......
......@@ -24,7 +24,7 @@
#include <errno.h>
#include <stdio.h>
#include <permafrost/httpp.h>
#include <igloo/httpp.h>
#include "auth.h"
#include "source.h"
......@@ -43,14 +43,14 @@
struct auth_stack_tag {
size_t refcount;
auth_t *auth;
mutex_t lock;
igloo_mutex_t lock;
auth_stack_t *next;
};
/* code */
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 unsigned long _next_auth_id(void) {
......@@ -116,7 +116,7 @@ static auth_client *auth_client_setup (client_t *client)
if (client->username || client->password)
break;
header = httpp_getvar(client->parser, "authorization");
header = igloo_httpp_getvar(client->parser, "authorization");
if (header == NULL)
break;
......@@ -199,7 +199,7 @@ void auth_release (auth_t *authenticator) {
if (authenticator->running) {
authenticator->running = 0;
thread_mutex_unlock(&authenticator->lock);
thread_join(authenticator->thread);
igloo_thread_join(authenticator->thread);
thread_mutex_lock(&authenticator->lock);
}
......@@ -212,7 +212,7 @@ void auth_release (auth_t *authenticator) {
if (authenticator->management_url)
xmlFree (authenticator->management_url);
thread_mutex_unlock(&authenticator->lock);
thread_mutex_destroy(&authenticator->lock);
igloo_thread_mutex_destroy(&authenticator->lock);
if (authenticator->mount)
free(authenticator->mount);
acl_release(authenticator->acl);
......@@ -243,11 +243,11 @@ static void auth_client_free (auth_client *auth_user)
/* verify that the client is still connected. */
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;
if (client)
if (sock_active(client->con->sock) == 0)
if (igloo_sock_active(client->con->sock) == 0)
ret = 0;
return ret;
*/
......@@ -424,7 +424,7 @@ static void *auth_run_thread (void *arg)
} else {
thread_mutex_unlock(&auth->lock);
}
thread_sleep (150000);
igloo_thread_sleep (150000);
}
ICECAST_LOG_INFO("Authentication thread shutting down");
return NULL;
......@@ -636,7 +636,7 @@ static inline int auth_get_authenticator__filter_method(auth_t *auth, xmlNodePtr
while (cur) {
char *next = strstr(cur, ",");
httpp_request_type_e idx;
igloo_httpp_request_type_e idx;
if (next) {
*next = 0;
......@@ -652,7 +652,7 @@ static inline int auth_get_authenticator__filter_method(auth_t *auth, xmlNodePtr
break;
}
idx = httpp_str_to_method(cur);
idx = igloo_httpp_str_to_method(cur);
if (idx == httpp_req_unknown) {
ICECAST_LOG_ERROR("Can not add known method \"%H\" to role's %s", cur, name);
return -1;
......@@ -759,7 +759,7 @@ auth_t *auth_get_authenticator(xmlNodePtr node)
method_inited = 1;
while (cur) {
httpp_request_type_e idx;
igloo_httpp_request_type_e idx;
next = strstr(cur, ",");
if (next) {
......@@ -774,7 +774,7 @@ auth_t *auth_get_authenticator(xmlNodePtr node)
break;
}
idx = httpp_str_to_method(cur);
idx = igloo_httpp_str_to_method(cur);
if (idx == httpp_req_unknown) {
auth_release(auth);
return NULL;
......@@ -859,7 +859,7 @@ auth_t *auth_get_authenticator(xmlNodePtr node)
auth->tailp = &auth->head;
if (!auth->immediate) {
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);
}
}
}
......@@ -934,7 +934,7 @@ void auth_initialise (void)
void auth_shutdown (void)
{
ICECAST_LOG_INFO("Auth shutdown");
thread_mutex_destroy(&_auth_lock);
igloo_thread_mutex_destroy(&_auth_lock);
}
/* authstack functions */
......@@ -976,7 +976,7 @@ void auth_stack_release(auth_stack_t *stack) {
auth_release(stack->auth);
auth_stack_release(stack->next);
thread_mutex_destroy(&stack->lock);
igloo_thread_mutex_destroy(&stack->lock);
free(stack);
}
......@@ -1092,7 +1092,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;
if (!stack || method < 0 || method > httpp_req_unknown)
......
......@@ -22,8 +22,8 @@
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <permafrost/thread.h>
#include <permafrost/httpp.h>
#include <igloo/thread.h>
#include <igloo/httpp.h>
#include "icecasttypes.h"
......@@ -134,11 +134,11 @@ struct auth_tag
auth_result (*deleteuser)(auth_t *auth, const char *username);
auth_result (*listuser)(auth_t *auth, xmlNodePtr srcnode);
mutex_t lock;
igloo_mutex_t lock;
int running;
size_t refcount;
thread_type *thread;
igloo_thread_type *thread;
/* per-auth queue for clients */
auth_client *head, **tailp;
......@@ -189,6 +189,6 @@ int auth_stack_push(auth_stack_t **stack, auth_t *auth);
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_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
......@@ -26,7 +26,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <permafrost/httpp.h>
#include <igloo/httpp.h>
#include "auth.h"
#include "source.h"
......@@ -53,8 +53,8 @@ typedef struct {
typedef struct {
char *filename;
rwlock_t file_rwlock;
avl_tree *users;
igloo_rwlock_t file_rwlock;
igloo_avl_tree *users;
time_t mtime;
} htpasswd_auth_state;
......@@ -63,8 +63,8 @@ static void htpasswd_clear(auth_t *self)
htpasswd_auth_state *state = self->state;
free(state->filename);
if (state->users)
avl_tree_free (state->users, _free_user);
thread_rwlock_destroy(&state->file_rwlock);
igloo_avl_tree_free (state->users, _free_user);
igloo_thread_rwlock_destroy(&state->file_rwlock);
free(state);
}
......@@ -109,7 +109,7 @@ static int _free_user(void *key)
static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd)
{
FILE *passwdfile;
avl_tree *new_users;
igloo_avl_tree *new_users;
int num = 0;
struct stat file_stat;
char *sep;
......@@ -123,7 +123,7 @@ static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd)
/* Create a dummy users tree for things to use later */
thread_rwlock_wlock (&htpasswd->file_rwlock);
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);
return;
......@@ -142,7 +142,7 @@ static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd)
}
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)) {
int len;
......@@ -163,13 +163,13 @@ static void htpasswd_recheckfile(htpasswd_auth_state *htpasswd)
*sep = 0;
memcpy (entry->name, line, len);
entry->pass = entry->name + (sep-line) + 1;
avl_insert (new_users, entry);
igloo_avl_insert (new_users, entry);
}
fclose (passwdfile);
thread_rwlock_wlock (&htpasswd->file_rwlock);
if (htpasswd->users)
avl_tree_free (htpasswd->users, _free_user);
igloo_avl_tree_free (htpasswd->users, _free_user);
htpasswd->users = new_users;
thread_rwlock_unlock (&htpasswd->file_rwlock);
}
......@@ -199,7 +199,7 @@ static auth_result htpasswd_auth (auth_client *auth_user)
thread_rwlock_rlock (&htpasswd->file_rwlock);
entry.name = client->username;
if (avl_get_by_key (htpasswd->users, &entry, &result) == 0) {
if (igloo_avl_get_by_key (htpasswd->users, &entry, &result) == 0) {
htpasswd_user *found = result;
char *hashed_pw;
......@@ -278,7 +278,7 @@ static auth_result htpasswd_adduser (auth_t *auth, const char *username, const c
thread_rwlock_wlock (&state->file_rwlock);
entry.name = (char*)username;
if (avl_get_by_key (state->users, &entry, &result) == 0) {
if (igloo_avl_get_by_key (state->users, &entry, &result) == 0) {
thread_rwlock_unlock (&state->file_rwlock);
return AUTH_USEREXISTS;
}
......@@ -406,7 +406,7 @@ static auth_result htpasswd_userlist(auth_t *auth, xmlNodePtr srcnode)
{
htpasswd_auth_state *state;
xmlNodePtr newnode;
avl_node *node;
igloo_avl_node *node;
state = auth->state;
......@@ -423,12 +423,12 @@ static auth_result htpasswd_userlist(auth_t *auth, xmlNodePtr srcnode)
}
thread_rwlock_rlock(&state->file_rwlock);
node = avl_get_first(state->users);
node = igloo_avl_get_first(state->users);
while (node) {
htpasswd_user *user = (htpasswd_user *)node->key;
newnode = xmlNewChild(srcnode, NULL, XMLSTR("user"), NULL);
xmlNewTextChild(newnode, NULL, XMLSTR("username"), XMLSTR(user->name));
node = avl_get_next(node);
node = igloo_avl_get_next(node);
}
thread_rwlock_unlock(&state->file_rwlock);
......
......@@ -75,7 +75,7 @@
#include "cfgfile.h"
#include "connection.h"
#include <permafrost/httpp.h>
#include <igloo/httpp.h>
#include "logging.h"
#define CATMODULE "auth_url"
......@@ -121,7 +121,7 @@ typedef struct {
typedef struct {
char *all_headers;
size_t all_headers_len;
http_parser_t *parser;
igloo_http_parser_t *parser;
} auth_user_url_t;
static inline const char * __str_or_default(const char *str, const char *def)
......@@ -187,15 +187,15 @@ static void handle_returned_header__complete(auth_client *auth_user)
if (au_url->parser)
return;
au_url->parser = httpp_create_parser();
httpp_initialize(au_url->parser, NULL);
au_url->parser = igloo_httpp_create_parser();
igloo_httpp_initialize(au_url->parser, NULL);
if (!httpp_parse_response(au_url->parser, au_url->all_headers, au_url->all_headers_len, NULL)) {
if (!igloo_httpp_parse_response(au_url->parser, au_url->all_headers, au_url->all_headers_len, NULL)) {
ICECAST_LOG_ERROR("Can not parse auth backend reply.");
return;
}
tmp = httpp_getvar(au_url->parser, HTTPP_VAR_ERROR_CODE);
tmp = igloo_httpp_getvar(au_url->parser, igloo_HTTPP_VAR_ERROR_CODE);
if (tmp[0] == '2') {
ICECAST_LOG_DEBUG("Got final status: %#H", tmp);
} else {
......@@ -207,14 +207,14 @@ static void handle_returned_header__complete(auth_client *auth_user)
}
if (url->header_auth) {
tmp = httpp_getvar(au_url->parser, url->header_auth);
tmp = igloo_httpp_getvar(au_url->parser, url->header_auth);
if (tmp) {
url->result = auth_str2result(tmp);
}
}
if (url->header_timelimit) {
tmp = httpp_getvar(au_url->parser, url->header_timelimit);
tmp = igloo_httpp_getvar(au_url->parser, url->header_timelimit);
if (tmp) {
long long int ret;
char *endptr;
......@@ -229,8 +229,8 @@ static void handle_returned_header__complete(auth_client *auth_user)
}
}
action = httpp_getvar(au_url->parser, __str_or_default(url->header_alter_action, DEFAULT_HEADER_NEW_ALTER_ACTION));
argument = httpp_getvar(au_url->parser, __str_or_default(url->header_alter_argument, DEFAULT_HEADER_NEW_ALTER_ARGUMENT));
action = igloo_httpp_getvar(au_url->parser, __str_or_default(url->header_alter_action, DEFAULT_HEADER_NEW_ALTER_ACTION));
argument = igloo_httpp_getvar(au_url->parser, __str_or_default(url->header_alter_argument, DEFAULT_HEADER_NEW_ALTER_ARGUMENT));
if (action && argument) {
if (auth_alter_client(auth_user->client->auth, auth_user, auth_str2alter(action), argument) != 0) {
......@@ -241,11 +241,11 @@ static void handle_returned_header__complete(auth_client *auth_user)
}
if (url->header_message) {
tmp = httpp_getvar(au_url->parser, url->header_message);
tmp = igloo_httpp_getvar(au_url->parser, url->header_message);
} else {
tmp = httpp_getvar(au_url->parser, DEFAULT_HEADER_NEW_MESSAGE);
tmp = igloo_httpp_getvar(au_url->parser, DEFAULT_HEADER_NEW_MESSAGE);
if (!tmp)
tmp = httpp_getvar(au_url->parser, DEFAULT_HEADER_OLD_MESSAGE);
tmp = igloo_httpp_getvar(au_url->parser, DEFAULT_HEADER_OLD_MESSAGE);
}
if (tmp) {
snprintf(url->errormsg, sizeof(url->errormsg), "%s", tmp);
......@@ -353,7 +353,7 @@ static auth_result url_remove_client(auth_client *auth_user)
port = config->port;
config_release_config();
agent = httpp_getvar(client->parser, "user-agent");
agent = igloo_httpp_getvar(client->parser, "user-agent");
if (agent) {
user_agent = util_url_escape(agent);
} else {
......@@ -373,9 +373,9 @@ static auth_result url_remove_client(auth_client *auth_user)
}
/* get the full uri (with query params if available) */
mountreq = httpp_getvar(client->parser, HTTPP_VAR_RAWURI);
mountreq = igloo_httpp_getvar(client->parser, igloo_HTTPP_VAR_RAWURI);
if (mountreq == NULL)
mountreq = httpp_getvar(client->parser, HTTPP_VAR_URI);
mountreq = igloo_httpp_getvar(client->parser, igloo_HTTPP_VAR_URI);
mount = util_url_escape(mountreq);
ipaddr = util_url_escape(client->con->ip);
......@@ -460,7 +460,7 @@ static auth_result url_add_client(auth_client *auth_user)
port = config->port;
config_release_config();
agent = httpp_getvar(client->parser, "user-agent");
agent = igloo_httpp_getvar(client->parser, "user-agent");
if (agent) {
user_agent = util_url_escape(agent);
} else {
......@@ -480,9 +480,9 @@ static auth_result url_add_client(auth_client *auth_user)
}
/* get the full uri (with query params if available) */
mountreq = httpp_getvar(client->parser, HTTPP_VAR_RAWURI);
mountreq = igloo_httpp_getvar(client->parser, igloo_HTTPP_VAR_RAWURI);
if (mountreq == NULL)
mountreq = httpp_getvar(client->parser, HTTPP_VAR_URI);
mountreq = igloo_httpp_getvar(client->parser, igloo_HTTPP_VAR_URI);
mount = util_url_escape(mountreq);
ipaddr = util_url_escape(client->con->ip);
......@@ -512,7 +512,7 @@ static auth_result url_add_client(auth_client *auth_user)
next_header++;
}
header_val = httpp_getvar (client->parser, cur_header);
header_val = igloo_httpp_getvar (client->parser, cur_header);
if (header_val) {
header_valesc = util_url_escape (header_val);
post_offset += snprintf(post + post_offset,
......
......@@ -26,7 +26,7 @@
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <permafrost/thread.h>
#include <igloo/thread.h>
#include "cfgfile.h"
#include "global.h"
......@@ -211,8 +211,8 @@ static void create_locks(void)
static void release_locks(void)
{
thread_mutex_destroy(&_locks.relay_lock);
thread_rwlock_destroy(&_locks.config_lock);
igloo_thread_mutex_destroy(&_locks.relay_lock);
igloo_thread_rwlock_destroy(&_locks.config_lock);
}
void config_initialize(void)
......
......@@ -23,8 +23,8 @@
#define MAX_YP_DIRECTORIES 25
#include <libxml/tree.h>
#include <permafrost/thread.h>
#include <permafrost/avl.h>
#include <igloo/thread.h>
#include <igloo/avl.h>
#include "icecasttypes.h"
#include "compat.h"
......@@ -277,8 +277,8 @@ struct ice_config_tag {
};
typedef struct {
rwlock_t config_lock;
mutex_t relay_lock;
igloo_rwlock_t config_lock;
igloo_mutex_t relay_lock;
} ice_config_locks;
void config_initialize(void);
......
......@@ -26,9 +26,9 @@
#include <libxml/tree.h>
#include <permafrost/thread.h>
#include <permafrost/avl.h>
#include <permafrost/httpp.h>
#include <igloo/thread.h>
#include <igloo/avl.h>
#include <igloo/httpp.h>
#include "global.h"
#include "refobject.h"
......@@ -70,7 +70,7 @@ static inline void client_send_500(client_t *client, const char *message);
* client_t is returned just in case a message needs to be returned. Should
* be called with global lock held.
*/
int client_create(client_t **c_ptr, connection_t *con, http_parser_t *parser)
int client_create(client_t **c_ptr, connection_t *con, igloo_http_parser_t *parser)
{
ice_config_t *config;
client_t *client = (client_t *) calloc(1, sizeof(client_t));
......@@ -122,7 +122,7 @@ void client_complete(client_t *client)
}
if (!have) {
header = httpp_getvar(client->parser, "transfer-encoding");
header = igloo_httpp_getvar(client->parser, "transfer-encoding");
if (header) {
if (strcasecmp(header, "identity") != 0) {
client->request_body_length = -1; /* streaming */
......@@ -132,7 +132,7 @@ void client_complete(client_t *client)
}
if (!have) {
header = httpp_getvar(client->parser, "content-length");
header = igloo_httpp_getvar(client->parser, "content-length");
if (header) {
if (sscanf(header, "%llu", &scannumber) == 1) {
client->request_body_length = scannumber;
......@@ -237,7 +237,7 @@ void client_destroy(client_t *client)
if (client->parser)
httpp_destroy(client->parser);
if (client->encoding)
httpp_encoding_release(client->encoding);
igloo_httpp_encoding_release(client->encoding);
global_lock();
global.clients--;
......@@ -286,7 +286,7 @@ int client_read_bytes(client_t *client, void *buf, unsigned len)
}
if (client->encoding) {
bytes = httpp_encoding_read(client->encoding, buf, len, reader, userdata);
bytes = igloo_httpp_encoding_read(client->encoding, buf, len, reader, userdata);
} else {
bytes = reader(userdata, buf, len);
}
......@@ -694,7 +694,7 @@ admin_format_t client_get_admin_format_by_content_negotiation(client_t *client)
if (!client || !client->parser)
return CLIENT_DEFAULT_ADMIN_FORMAT;
pref = util_http_select_best(httpp_getvar(client->parser, "accept"), "text/xml", "text/html", "text/plain", (const char*)NULL);
pref = util_http_select_best(igloo_httpp_getvar(client->parser, "accept"), "text/xml", "text/html", "text/plain", (const char*)NULL);
if (strcmp(pref, "text/xml") == 0) {
return ADMIN_FORMAT_RAW;
......@@ -787,7 +787,7 @@ int client_body_eof(client_t *client)
ret = 1;
} else if (client->encoding) {
ICECAST_LOG_DEBUG("Looking for body EOF with encoding (client=%p)", client);
ret = httpp_encoding_eof(client->encoding, (int(*)(void*))client_eof, client);
ret = igloo_httpp_encoding_eof(client->encoding, (int(*)(void*))client_eof, client);
} else {
ICECAST_LOG_DEBUG("Looking for body EOF without encoding (client=%p)", client);
ret = client_eof(client);
......@@ -931,7 +931,7 @@ ssize_t client_get_baseurl(client_t *client, listensocket_t *listensocket, char
suffix1 = "";
if (client) {
host = httpp_getvar(client->parser, "host");
host = igloo_httpp_getvar(client->parser, "host");
/* at least a couple of players (fb2k/winamp) are reported to send a
* host header but without the port number. So if we are missing the
......
......@@ -19,8 +19,8 @@
#ifndef __CLIENT_H__
#define __CLIENT_H__
#include <permafrost/httpp.h>