Commit b9a08055 authored by Ilkka Ollakka's avatar Ilkka Ollakka

livehttp: parse key="value" style options

parent 46e2b31e
...@@ -496,9 +496,21 @@ static char *parse_Attributes(const char *line, const char *attr) ...@@ -496,9 +496,21 @@ static char *parse_Attributes(const char *line, const char *attr)
if (strncasecmp(begin, attr, strlen(attr)) == 0 if (strncasecmp(begin, attr, strlen(attr)) == 0
&& begin[strlen(attr)] == '=') && begin[strlen(attr)] == '=')
{ {
/* <attr>=<value>[,]* */ /* <attr>="<value>"[,]* */
p = strchr(begin, ','); p = strchr(begin, ',');
begin += strlen(attr) + 1; begin += strlen(attr) + 1;
/* Check if we have " " marked value*/
if( begin[0] == '"' )
{
char *valueend = strchr( begin+1, '"');
/* No ending " so bail out */
if( unlikely( !valueend ) )
return NULL;
p = strchr( valueend, ',');
}
if (begin >= end) if (begin >= end)
return NULL; return NULL;
if (p == NULL) /* last attribute */ if (p == NULL) /* last attribute */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment