mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-19 21:06:42 +00:00
libavformat/http: add support for headers option in listen mode
Instead of silently ignoring the headers option in listen mode, use the provided headers. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
17eb0042bc
commit
e8b355a028
@ -371,12 +371,14 @@ static int http_write_reply(URLContext* h, int status_code)
|
|||||||
"HTTP/1.1 %03d %s\r\n"
|
"HTTP/1.1 %03d %s\r\n"
|
||||||
"Content-Type: %s\r\n"
|
"Content-Type: %s\r\n"
|
||||||
"Content-Length: %"SIZE_SPECIFIER"\r\n"
|
"Content-Length: %"SIZE_SPECIFIER"\r\n"
|
||||||
|
"%s"
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"%03d %s\r\n",
|
"%03d %s\r\n",
|
||||||
reply_code,
|
reply_code,
|
||||||
reply_text,
|
reply_text,
|
||||||
content_type,
|
content_type,
|
||||||
strlen(reply_text) + 6, // 3 digit status code + space + \r\n
|
strlen(reply_text) + 6, // 3 digit status code + space + \r\n
|
||||||
|
s->headers ? s->headers : "",
|
||||||
reply_code,
|
reply_code,
|
||||||
reply_text);
|
reply_text);
|
||||||
} else {
|
} else {
|
||||||
@ -385,10 +387,12 @@ static int http_write_reply(URLContext* h, int status_code)
|
|||||||
"HTTP/1.1 %03d %s\r\n"
|
"HTTP/1.1 %03d %s\r\n"
|
||||||
"Content-Type: %s\r\n"
|
"Content-Type: %s\r\n"
|
||||||
"Transfer-Encoding: chunked\r\n"
|
"Transfer-Encoding: chunked\r\n"
|
||||||
|
"%s"
|
||||||
"\r\n",
|
"\r\n",
|
||||||
reply_code,
|
reply_code,
|
||||||
reply_text,
|
reply_text,
|
||||||
content_type);
|
content_type,
|
||||||
|
s->headers ? s->headers : "");
|
||||||
}
|
}
|
||||||
av_log(h, AV_LOG_TRACE, "HTTP reply header: \n%s----\n", message);
|
av_log(h, AV_LOG_TRACE, "HTTP reply header: \n%s----\n", message);
|
||||||
if ((ret = ffurl_write(s->hd, message, message_len)) < 0)
|
if ((ret = ffurl_write(s->hd, message, message_len)) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user