mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2025-04-18 00:48:46 -04: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:
parent
2566c7f75b
commit
508795aa8b
@ -2,7 +2,7 @@
|
|||||||
* Copyright (C) 1995 by Sam Rushing <rushing@nightmare.com>
|
* 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
|
#ifndef __AVL_H
|
||||||
#define __AVL_H
|
#define __AVL_H
|
||||||
@ -11,6 +11,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "thread.h"
|
||||||
|
|
||||||
typedef struct avl_node_tag {
|
typedef struct avl_node_tag {
|
||||||
void * key;
|
void * key;
|
||||||
struct avl_node_tag * left;
|
struct avl_node_tag * left;
|
||||||
|
@ -62,10 +62,11 @@ int httpp_parse(http_parser_t *parser, char *http_data, unsigned long len)
|
|||||||
if (http_data == NULL)
|
if (http_data == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* make a local copy of the data */
|
/* make a local copy of the data, including 0 terminator */
|
||||||
data = (char *)malloc(len);
|
data = (char *)malloc(len+1);
|
||||||
if (data == NULL) return 0;
|
if (data == NULL) return 0;
|
||||||
memcpy(data, http_data, len);
|
memcpy(data, http_data, len);
|
||||||
|
data[len] = 0;
|
||||||
|
|
||||||
/* first we count how many lines there are
|
/* first we count how many lines there are
|
||||||
** and set up the line[] array
|
** and set up the line[] array
|
||||||
@ -77,16 +78,14 @@ int httpp_parse(http_parser_t *parser, char *http_data, unsigned long len)
|
|||||||
data[i] = '\0';
|
data[i] = '\0';
|
||||||
if (data[i] == '\n') {
|
if (data[i] == '\n') {
|
||||||
lines++;
|
lines++;
|
||||||
if (i + 1 < len)
|
|
||||||
if (data[i + 1] == '\n' || data[i + 1] == '\r') {
|
|
||||||
data[i] = '\0';
|
data[i] = '\0';
|
||||||
|
if (i + 1 < len) {
|
||||||
|
if (data[i + 1] == '\n' || data[i + 1] == '\r')
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
data[i] = '\0';
|
|
||||||
if (i < len - 1)
|
|
||||||
line[lines] = &data[i + 1];
|
line[lines] = &data[i + 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
while (data[i] == '\n') i++;
|
while (data[i] == '\n') i++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user