* Allow larger fields in UPnP requests, to work better with long Logitech Revue Search requests.

This commit is contained in:
Justin Maggard 2011-08-16 22:20:51 +00:00
parent eb0278a905
commit 2a164e31d4
2 changed files with 7 additions and 7 deletions

View File

@ -47,11 +47,11 @@ NameValueParserStartElt(void * d, const char * name, int l)
if(!data->head.lh_first) if(!data->head.lh_first)
{ {
struct NameValue * nv; struct NameValue * nv;
nv = malloc(sizeof(struct NameValue)); nv = malloc(sizeof(struct NameValue)+l+1);
strcpy(nv->name, "rootElement"); strcpy(nv->name, "rootElement");
memcpy(nv->value, name, l); memcpy(nv->value, name, l);
nv->value[l] = '\0'; nv->value[l] = '\0';
LIST_INSERT_HEAD( &(data->head), nv, entries); LIST_INSERT_HEAD(&(data->head), nv, entries);
} }
} }
@ -60,14 +60,14 @@ NameValueParserGetData(void * d, const char * datas, int l)
{ {
struct NameValueParserData * data = (struct NameValueParserData *)d; struct NameValueParserData * data = (struct NameValueParserData *)d;
struct NameValue * nv; struct NameValue * nv;
nv = malloc(sizeof(struct NameValue)); if(l>1975)
if(l>511) l = 1975;
l = 511; nv = malloc(sizeof(struct NameValue)+l+1);
strncpy(nv->name, data->curelt, 64); strncpy(nv->name, data->curelt, 64);
nv->name[63] = '\0'; nv->name[63] = '\0';
memcpy(nv->value, datas, l); memcpy(nv->value, datas, l);
nv->value[l] = '\0'; nv->value[l] = '\0';
LIST_INSERT_HEAD( &(data->head), nv, entries); LIST_INSERT_HEAD(&(data->head), nv, entries);
} }
void void

View File

@ -38,7 +38,7 @@ extern "C" {
struct NameValue { struct NameValue {
LIST_ENTRY(NameValue) entries; LIST_ENTRY(NameValue) entries;
char name[64]; char name[64];
char value[512]; char value[];
}; };
struct NameValueParserData { struct NameValueParserData {