Commit 1d19f1b1 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '393d80cc'

* commit '393d80cc':
  http: Support relative URL redirection

Conflicts:
	libavformat/http.c

See: 4a4c93cbMerged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 45ab71a8 393d80cc
...@@ -317,7 +317,6 @@ static int process_line(URLContext *h, char *line, int line_count, ...@@ -317,7 +317,6 @@ static int process_line(URLContext *h, char *line, int line_count,
{ {
HTTPContext *s = h->priv_data; HTTPContext *s = h->priv_data;
char *tag, *p, *end; char *tag, *p, *end;
char redirected_location[MAX_URL_SIZE];
/* end of header */ /* end of header */
if (line[0] == '\0') { if (line[0] == '\0') {
...@@ -357,7 +356,9 @@ static int process_line(URLContext *h, char *line, int line_count, ...@@ -357,7 +356,9 @@ static int process_line(URLContext *h, char *line, int line_count,
while (av_isspace(*p)) while (av_isspace(*p))
p++; p++;
if (!av_strcasecmp(tag, "Location")) { if (!av_strcasecmp(tag, "Location")) {
ff_make_absolute_url(redirected_location, sizeof(redirected_location), s->location, p); char redirected_location[MAX_URL_SIZE];
ff_make_absolute_url(redirected_location, sizeof(redirected_location),
s->location, p);
av_strlcpy(s->location, redirected_location, sizeof(s->location)); av_strlcpy(s->location, redirected_location, sizeof(s->location));
*new_location = 1; *new_location = 1;
} else if (!av_strcasecmp (tag, "Content-Length") && s->filesize == -1) { } else if (!av_strcasecmp (tag, "Content-Length") && s->filesize == -1) {
......
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