aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-17 20:40:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-17 20:49:01 +0200
commit3d40ba3d81276c659191b0de9653e9ec69c090f1 (patch)
tree79dc6edeb61840f3783430a83c5f64291743d9f3
parenta3329a09f93455a44ff3c9c64886c4da1f66bcfb (diff)
parent4bebce06175a6a15253c341c180d95cd97c9494b (diff)
downloadffmpeg-3d40ba3d81276c659191b0de9653e9ec69c090f1.tar.gz
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: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/http.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 7480834ec3..018d25c9d7 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -565,8 +565,11 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path,
set_cookies = NULL;
while ((param = av_strtok(cookie, "; ", &next_param))) {
- cookie = NULL;
- if (!av_strncasecmp("path=", param, 5)) {
+ if (cookie) {
+ // 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);
cpath = av_strdup(&param[5]);
} else if (!av_strncasecmp("domain=", param, 7)) {
@@ -575,14 +578,8 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path,
int leading_dot = (param[7] == '.');
av_free(cdomain);
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 {
- av_free(cvalue);
- cvalue = av_strdup(param);
+ // ignore unknown attributes
}
}
if (!cdomain)