Ticket #3806: cookies.patch

File cookies.patch, 1.8 KB (added by Nick Ayers, 12 years ago)
  • libavformat/http.c

    diff --git a/libavformat/http.c b/libavformat/http.c
    index 33585b0..4acb175 100644
    a b static int get_cookies(HTTPContext *s, char **cookies, const char *path,  
    548548        char *param, *next_param, *cdomain = NULL, *cpath = NULL, *cvalue = NULL;
    549549        set_cookies = NULL;
    550550
    551         while ((param = av_strtok(cookie, "; ", &next_param))) {
     551        while ((param = av_strtok(cookie, ";", &next_param))) {
    552552            cookie = NULL;
     553            if (next_param)
     554                while (av_isspace(*next_param)) next_param++;
    553555            if        (!av_strncasecmp("path=",   param, 5)) {
    554556                av_free(cpath);
    555557                cpath = av_strdup(&param[5]);
    … … static int get_cookies(HTTPContext *s, char **cookies, const char *path,  
    559561                int leading_dot = (param[7] == '.');
    560562                av_free(cdomain);
    561563                cdomain = av_strdup(&param[7+leading_dot]);
    562             } else if (!av_strncasecmp("secure",  param, 6) ||
    563                        !av_strncasecmp("comment", param, 7) ||
    564                        !av_strncasecmp("max-age", param, 7) ||
    565                        !av_strncasecmp("version", param, 7)) {
    566                 // ignore Comment, Max-Age, Secure and Version
     564            } else if (!av_strncasecmp("secure",   param, 6) ||
     565                       !av_strncasecmp("comment",  param, 7) ||
     566                       !av_strncasecmp("expires",  param, 7) ||
     567                       !av_strncasecmp("max-age",  param, 7) ||
     568                       !av_strncasecmp("version",  param, 7) ||
     569                       !av_strncasecmp("httponly", param, 8)) {
     570                // ignore Comment, Expires, HttpOnly, Max-Age, Secure and Version
    567571            } else {
    568572                av_free(cvalue);
    569573                cvalue = av_strdup(param);