Commit 3d40ba3d authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'cigaes/master'

* cigaes/master:
  lavf/http: remove special case for cookies attributes.
  lavf/http: fix cookie parsing.

Reviewed-by: Ronald S. Bultje
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents a3329a09 4bebce06
...@@ -565,8 +565,11 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path, ...@@ -565,8 +565,11 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path,
set_cookies = NULL; set_cookies = NULL;
while ((param = av_strtok(cookie, "; ", &next_param))) { while ((param = av_strtok(cookie, "; ", &next_param))) {
cookie = NULL; if (cookie) {
if (!av_strncasecmp("path=", param, 5)) { // first key-value pair is the actual cookie value
cvalue = av_strdup(param);
cookie = NULL;
} else if (!av_strncasecmp("path=", param, 5)) {
av_free(cpath); av_free(cpath);
cpath = av_strdup(&param[5]); cpath = av_strdup(&param[5]);
} else if (!av_strncasecmp("domain=", param, 7)) { } else if (!av_strncasecmp("domain=", param, 7)) {
...@@ -575,14 +578,8 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path, ...@@ -575,14 +578,8 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path,
int leading_dot = (param[7] == '.'); int leading_dot = (param[7] == '.');
av_free(cdomain); av_free(cdomain);
cdomain = av_strdup(&param[7+leading_dot]); cdomain = av_strdup(&param[7+leading_dot]);
} else if (!av_strncasecmp("secure", param, 6) ||
!av_strncasecmp("comment", param, 7) ||
!av_strncasecmp("max-age", param, 7) ||
!av_strncasecmp("version", param, 7)) {
// ignore Comment, Max-Age, Secure and Version
} else { } else {
av_free(cvalue); // ignore unknown attributes
cvalue = av_strdup(param);
} }
} }
if (!cdomain) if (!cdomain)
......
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