mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
minor fixes. autoconf/make init clenaup, missing includes added and
compiler warnings removed svn path=/trunk/icecast/; revision=5173
This commit is contained in:
parent
14918d3831
commit
69de4ea61e
11
configure.in
11
configure.in
@ -1,9 +1,12 @@
|
|||||||
AC_INIT(src/main.c)
|
AC_INIT([Icecast], [2.0-alpha-2], [icecast@xiph.org])
|
||||||
|
|
||||||
AC_PREREQ(2.54)
|
AC_PREREQ(2.54)
|
||||||
|
AC_CONFIG_SRCDIR(src/main.c)
|
||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AM_INIT_AUTOMAKE(icecast,2.0-alpha-2)
|
AM_INIT_AUTOMAKE
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
@ -51,8 +54,8 @@ dnl Checks for header files.
|
|||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
|
|
||||||
AC_CHECK_HEADERS([alloca.h])
|
AC_CHECK_HEADERS([alloca.h])
|
||||||
AC_CHECK_HEADER(pwd.h, AC_DEFINE(CHUID, 1, [Define if you have pwd.h]),,)
|
AC_CHECK_HEADERS(pwd.h, AC_DEFINE(CHUID, 1, [Define if you have pwd.h]),,)
|
||||||
AC_CHECK_HEADER(unistd.h, AC_DEFINE(CHROOT, 1, [Define if you have unistd.h]),,)
|
AC_CHECK_HEADERS(unistd.h, AC_DEFINE(CHROOT, 1, [Define if you have unistd.h]),,)
|
||||||
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ xmlDocPtr admin_build_sourcelist(char *current_source)
|
|||||||
void admin_send_response(xmlDocPtr doc, client_t *client,
|
void admin_send_response(xmlDocPtr doc, client_t *client,
|
||||||
int response, char *xslt_template)
|
int response, char *xslt_template)
|
||||||
{
|
{
|
||||||
char *buff = NULL;
|
xmlChar *buff = NULL;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
ice_config_t *config;
|
ice_config_t *config;
|
||||||
char *fullpath_xslt_template;
|
char *fullpath_xslt_template;
|
||||||
@ -197,7 +197,7 @@ void admin_send_response(xmlDocPtr doc, client_t *client,
|
|||||||
|
|
||||||
client->respcode = 200;
|
client->respcode = 200;
|
||||||
if (response == RAW) {
|
if (response == RAW) {
|
||||||
xmlDocDumpMemory(doc, (xmlChar **)&buff, &len);
|
xmlDocDumpMemory(doc, &buff, &len);
|
||||||
html_write(client, "HTTP/1.0 200 OK\r\n"
|
html_write(client, "HTTP/1.0 200 OK\r\n"
|
||||||
"Content-Length: %d\r\n"
|
"Content-Length: %d\r\n"
|
||||||
"Content-Type: text/xml\r\n"
|
"Content-Type: text/xml\r\n"
|
||||||
|
17
src/fserve.c
17
src/fserve.c
@ -321,10 +321,13 @@ static char *fserve_content_type(char *path)
|
|||||||
{
|
{
|
||||||
char *ext = util_get_extension(path);
|
char *ext = util_get_extension(path);
|
||||||
mime_type exttype = {ext, NULL};
|
mime_type exttype = {ext, NULL};
|
||||||
mime_type *result;
|
void *result;
|
||||||
|
|
||||||
if(!avl_get_by_key(mimetypes, &exttype, (void **)(&result)))
|
if (!avl_get_by_key (mimetypes, &exttype, &result))
|
||||||
return result->type;
|
{
|
||||||
|
mime_type *mime = result;
|
||||||
|
return mime->type;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* Fallbacks for a few basic ones */
|
/* Fallbacks for a few basic ones */
|
||||||
if(!strcmp(ext, "ogg"))
|
if(!strcmp(ext, "ogg"))
|
||||||
@ -459,7 +462,7 @@ static void create_mime_mappings(char *fn) {
|
|||||||
FILE *mimefile = fopen(fn, "r");
|
FILE *mimefile = fopen(fn, "r");
|
||||||
char line[4096];
|
char line[4096];
|
||||||
char *type, *ext, *cur;
|
char *type, *ext, *cur;
|
||||||
mime_type *mapping, *tmp;
|
mime_type *mapping;
|
||||||
|
|
||||||
mimetypes = avl_tree_new(_compare_mappings, NULL);
|
mimetypes = avl_tree_new(_compare_mappings, NULL);
|
||||||
|
|
||||||
@ -494,12 +497,14 @@ static void create_mime_mappings(char *fn) {
|
|||||||
while(*cur != ' ' && *cur != '\t' && *cur != '\n' && *cur)
|
while(*cur != ' ' && *cur != '\t' && *cur != '\n' && *cur)
|
||||||
cur++;
|
cur++;
|
||||||
*cur++ = 0;
|
*cur++ = 0;
|
||||||
if(*ext) {
|
if(*ext)
|
||||||
|
{
|
||||||
|
void *tmp;
|
||||||
/* Add a new extension->type mapping */
|
/* Add a new extension->type mapping */
|
||||||
mapping = malloc(sizeof(mime_type));
|
mapping = malloc(sizeof(mime_type));
|
||||||
mapping->ext = strdup(ext);
|
mapping->ext = strdup(ext);
|
||||||
mapping->type = strdup(type);
|
mapping->type = strdup(type);
|
||||||
if(!avl_get_by_key(mimetypes, mapping, (void **)(&tmp)))
|
if(!avl_get_by_key(mimetypes, mapping, &tmp))
|
||||||
avl_delete(mimetypes, mapping, _delete_mapping);
|
avl_delete(mimetypes, mapping, _delete_mapping);
|
||||||
avl_insert(mimetypes, mapping);
|
avl_insert(mimetypes, mapping);
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "thread/thread.h"
|
#include "thread/thread.h"
|
||||||
#include "avl/avl.h"
|
#include "avl/avl.h"
|
||||||
#include "net/sock.h"
|
#include "net/sock.h"
|
||||||
@ -19,10 +23,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CHROOT
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "cfgfile.h"
|
#include "cfgfile.h"
|
||||||
#include "sighandler.h"
|
#include "sighandler.h"
|
||||||
|
|
||||||
@ -38,6 +38,7 @@
|
|||||||
#include "fserve.h"
|
#include "fserve.h"
|
||||||
#ifdef USE_YP
|
#ifdef USE_YP
|
||||||
#include "geturl.h"
|
#include "geturl.h"
|
||||||
|
#include "yp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libxml/xmlmemory.h>
|
#include <libxml/xmlmemory.h>
|
||||||
|
@ -158,14 +158,14 @@ int source_free_source(void *key)
|
|||||||
client_t *source_find_client(source_t *source, int id)
|
client_t *source_find_client(source_t *source, int id)
|
||||||
{
|
{
|
||||||
client_t fakeclient;
|
client_t fakeclient;
|
||||||
client_t *result;
|
void *result;
|
||||||
connection_t fakecon;
|
connection_t fakecon;
|
||||||
|
|
||||||
fakeclient.con = &fakecon;
|
fakeclient.con = &fakecon;
|
||||||
fakeclient.con->id = id;
|
fakeclient.con->id = id;
|
||||||
|
|
||||||
avl_tree_rlock(source->client_tree);
|
avl_tree_rlock(source->client_tree);
|
||||||
if(avl_get_by_key(source->client_tree, &fakeclient, (void **)&result) == 0)
|
if(avl_get_by_key(source->client_tree, &fakeclient, &result) == 0)
|
||||||
{
|
{
|
||||||
avl_tree_unlock(source->client_tree);
|
avl_tree_unlock(source->client_tree);
|
||||||
return result;
|
return result;
|
||||||
|
@ -806,7 +806,7 @@ void stats_sendxml(client_t *client)
|
|||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
xmlNodePtr node, srcnode;
|
xmlNodePtr node, srcnode;
|
||||||
int len;
|
int len;
|
||||||
char *buff = NULL;
|
xmlChar *buff = NULL;
|
||||||
source_xml_t *snd;
|
source_xml_t *snd;
|
||||||
source_xml_t *src_nodes = NULL;
|
source_xml_t *src_nodes = NULL;
|
||||||
|
|
||||||
@ -831,7 +831,7 @@ void stats_sendxml(client_t *client)
|
|||||||
event = _get_event_from_queue(&queue);
|
event = _get_event_from_queue(&queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlDocDumpMemory(doc, (xmlChar **)&buff, &len);
|
xmlDocDumpMemory(doc, &buff, &len);
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
|
|
||||||
client->respcode = 200;
|
client->respcode = 200;
|
||||||
|
Loading…
Reference in New Issue
Block a user