1
0
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:
Karl Heyes 2003-07-24 16:21:22 +00:00
parent 14918d3831
commit 69de4ea61e
7 changed files with 30 additions and 20 deletions

View File

@ -1,9 +1,12 @@
AC_INIT(src/main.c)
AC_INIT([Icecast], [2.0-alpha-2], [icecast@xiph.org])
AC_PREREQ(2.54)
AC_CONFIG_SRCDIR(src/main.c)
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_MAINTAINER_MODE
AC_PROG_CC
AC_CANONICAL_HOST
@ -51,8 +54,8 @@ dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([alloca.h])
AC_CHECK_HEADER(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(pwd.h, AC_DEFINE(CHUID, 1, [Define if you have pwd.h]),,)
AC_CHECK_HEADERS(unistd.h, AC_DEFINE(CHROOT, 1, [Define if you have unistd.h]),,)
dnl Checks for typedefs, structures, and compiler characteristics.

View File

@ -188,7 +188,7 @@ xmlDocPtr admin_build_sourcelist(char *current_source)
void admin_send_response(xmlDocPtr doc, client_t *client,
int response, char *xslt_template)
{
char *buff = NULL;
xmlChar *buff = NULL;
int len = 0;
ice_config_t *config;
char *fullpath_xslt_template;
@ -197,7 +197,7 @@ void admin_send_response(xmlDocPtr doc, client_t *client,
client->respcode = 200;
if (response == RAW) {
xmlDocDumpMemory(doc, (xmlChar **)&buff, &len);
xmlDocDumpMemory(doc, &buff, &len);
html_write(client, "HTTP/1.0 200 OK\r\n"
"Content-Length: %d\r\n"
"Content-Type: text/xml\r\n"

View File

@ -321,10 +321,13 @@ static char *fserve_content_type(char *path)
{
char *ext = util_get_extension(path);
mime_type exttype = {ext, NULL};
mime_type *result;
void *result;
if(!avl_get_by_key(mimetypes, &exttype, (void **)(&result)))
return result->type;
if (!avl_get_by_key (mimetypes, &exttype, &result))
{
mime_type *mime = result;
return mime->type;
}
else {
/* Fallbacks for a few basic ones */
if(!strcmp(ext, "ogg"))
@ -459,7 +462,7 @@ static void create_mime_mappings(char *fn) {
FILE *mimefile = fopen(fn, "r");
char line[4096];
char *type, *ext, *cur;
mime_type *mapping, *tmp;
mime_type *mapping;
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)
cur++;
*cur++ = 0;
if(*ext) {
if(*ext)
{
void *tmp;
/* Add a new extension->type mapping */
mapping = malloc(sizeof(mime_type));
mapping->ext = strdup(ext);
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_insert(mimetypes, mapping);
}

View File

@ -6,6 +6,10 @@
#include <stdio.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "thread/thread.h"
#include "avl/avl.h"
#include "net/sock.h"
@ -19,10 +23,6 @@
#include <errno.h>
#endif
#ifdef CHROOT
#include <unistd.h>
#endif
#include "cfgfile.h"
#include "sighandler.h"
@ -38,6 +38,7 @@
#include "fserve.h"
#ifdef USE_YP
#include "geturl.h"
#include "yp.h"
#endif
#include <libxml/xmlmemory.h>

View File

@ -158,14 +158,14 @@ int source_free_source(void *key)
client_t *source_find_client(source_t *source, int id)
{
client_t fakeclient;
client_t *result;
void *result;
connection_t fakecon;
fakeclient.con = &fakecon;
fakeclient.con->id = id;
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);
return result;

View File

@ -806,7 +806,7 @@ void stats_sendxml(client_t *client)
xmlDocPtr doc;
xmlNodePtr node, srcnode;
int len;
char *buff = NULL;
xmlChar *buff = NULL;
source_xml_t *snd;
source_xml_t *src_nodes = NULL;
@ -831,7 +831,7 @@ void stats_sendxml(client_t *client)
event = _get_event_from_queue(&queue);
}
xmlDocDumpMemory(doc, (xmlChar **)&buff, &len);
xmlDocDumpMemory(doc, &buff, &len);
xmlFreeDoc(doc);
client->respcode = 200;

View File

@ -17,6 +17,7 @@
#include "geturl.h"
#include "source.h"
#include "cfgfile.h"
#include "stats.h"
#define CATMODULE "yp"