Commit a1601846 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

lavf: forward protocol_whitelist for the remaining cases

Also set a default_whitelist for mmsh and ffrtmphttp.
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 04a8bbca
......@@ -246,6 +246,14 @@ static int mmsh_open_internal(URLContext *h, const char *uri, int flags, int tim
host, port, mmsh->request_seq++);
av_opt_set(mms->mms_hd->priv_data, "headers", headers, 0);
if (!mms->mms_hd->protocol_whitelist && h->protocol_whitelist) {
mms->mms_hd->protocol_whitelist = av_strdup(h->protocol_whitelist);
if (!mms->mms_hd->protocol_whitelist) {
err = AVERROR(ENOMEM);
goto fail;
}
}
err = ffurl_connect(mms->mms_hd, NULL);
if (err) {
goto fail;
......@@ -410,4 +418,5 @@ const URLProtocol ff_mmsh_protocol = {
.url_read_seek = mmsh_read_seek,
.priv_data_size = sizeof(MMSHContext),
.flags = URL_PROTOCOL_FLAG_NETWORK,
.default_whitelist = "http,tcp",
};
......@@ -220,6 +220,14 @@ static int rtmp_http_open(URLContext *h, const char *uri, int flags)
av_opt_set(rt->stream->priv_data, "multiple_requests", "1", 0);
av_opt_set_bin(rt->stream->priv_data, "post_data", "", 1, 0);
if (!rt->stream->protocol_whitelist && h->protocol_whitelist) {
rt->stream->protocol_whitelist = av_strdup(h->protocol_whitelist);
if (!rt->stream->protocol_whitelist) {
ret = AVERROR(ENOMEM);
goto fail;
}
}
/* open the http context */
if ((ret = ffurl_connect(rt->stream, NULL)) < 0)
goto fail;
......@@ -274,4 +282,5 @@ const URLProtocol ff_ffrtmphttp_protocol = {
.priv_data_size = sizeof(RTMP_HTTPContext),
.flags = URL_PROTOCOL_FLAG_NETWORK,
.priv_data_class= &ffrtmphttp_class,
.default_whitelist = "https,http,tcp,tls",
};
......@@ -1752,6 +1752,14 @@ redirect:
sessioncookie);
av_opt_set(rt->rtsp_hd->priv_data, "headers", headers, 0);
if (!rt->rtsp_hd->protocol_whitelist && s->protocol_whitelist) {
rt->rtsp_hd->protocol_whitelist = av_strdup(s->protocol_whitelist);
if (!rt->rtsp_hd->protocol_whitelist) {
err = AVERROR(ENOMEM);
goto fail;
}
}
/* complete the connection */
if (ffurl_connect(rt->rtsp_hd, NULL)) {
err = AVERROR(EIO);
......
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