1
0
mirror of https://gitlab.xiph.org/xiph/icecast-common.git synced 2024-11-03 04:17:20 -05:00

Bunch of fixes:

- connections are now matched to format plugins based on content-type headers,
   and are rejected if there isn't a format handler for that content-type, or
   there is no content-type at all.
 - format_vorbis now handles pages with granulepos of -1 in the headers
   correctly (this happens if the headers are fairly large, because of
   many comments, for example).
 - various #include fixes.
 - buffer overflow in httpp.c fixed.

svn path=/trunk/avl/; revision=3042
This commit is contained in:
Michael Smith 2002-02-11 09:11:18 +00:00
parent 2566c7f75b
commit 508795aa8b
2 changed files with 10 additions and 9 deletions

View File

@ -2,7 +2,7 @@
* Copyright (C) 1995 by Sam Rushing <rushing@nightmare.com>
*/
/* $Id: avl.h,v 1.1 2001/09/10 02:28:03 jack Exp $ */
/* $Id: avl.h,v 1.2 2002/02/11 09:11:18 msmith Exp $ */
#ifndef __AVL_H
#define __AVL_H
@ -11,6 +11,8 @@
extern "C" {
#endif
#include "thread.h"
typedef struct avl_node_tag {
void * key;
struct avl_node_tag * left;

View File

@ -62,10 +62,11 @@ int httpp_parse(http_parser_t *parser, char *http_data, unsigned long len)
if (http_data == NULL)
return 0;
/* make a local copy of the data */
data = (char *)malloc(len);
/* make a local copy of the data, including 0 terminator */
data = (char *)malloc(len+1);
if (data == NULL) return 0;
memcpy(data, http_data, len);
data[len] = 0;
/* first we count how many lines there are
** and set up the line[] array
@ -77,14 +78,12 @@ int httpp_parse(http_parser_t *parser, char *http_data, unsigned long len)
data[i] = '\0';
if (data[i] == '\n') {
lines++;
if (i + 1 < len)
if (data[i + 1] == '\n' || data[i + 1] == '\r') {
data[i] = '\0';
break;
}
data[i] = '\0';
if (i < len - 1)
if (i + 1 < len) {
if (data[i + 1] == '\n' || data[i + 1] == '\r')
break;
line[lines] = &data[i + 1];
}
}
}