1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2025-01-03 14:56:34 -05:00

update for win32 build. Allow for more source stats and add boundary check

svn path=/icecast/trunk/icecast/; revision=13547
This commit is contained in:
Karl Heyes 2007-08-14 23:00:32 +00:00
parent f1c6cf9d4e
commit be75324e6c

View File

@ -43,7 +43,7 @@ CString gConfigurationSave;
char gTitleSource[1024] = "";
char gTitleName[1024] = "";
#define MAXSTATSPERSOURCE 30
#define MAXSTATSPERSOURCE 60
#define MAXSOURCES 1024
typedef struct tagElement {
@ -472,6 +472,8 @@ void AddUpdateStatistic(int sourceIndex, char *name, char *value)
}
}
int numStats = gStats[sourceIndex].numStats;
if (numStats >= MAXSTATSPERSOURCE)
return;
/* If we get here, we haven't found the stat, so add it */
gStats[sourceIndex].stats[numStats].name = name;
gStats[sourceIndex].stats[numStats].value = value;
@ -488,6 +490,8 @@ int GetSourceIndex(char *sourceName)
return i;
}
}
if (numMainStats >= MAXSOURCES)
return 0;
/* This means we haven't seen the source, so lets add it */
numMainStats++;
gStats[numMainStats].source = sourceName;
@ -537,7 +541,7 @@ void StartStats(void *dummy)
xmlDocPtr doc;
stats_get_xml(&doc, 0);
stats_get_xml(&doc, 0, NULL);
xmlNodePtr cur;
cur = xmlDocGetRootElement(doc);