diff options
author | Michael Niedermayer | 2016-01-30 02:17:51 +0100 |
---|---|---|
committer | Michael Niedermayer | 2016-02-02 04:16:50 +0100 |
commit | fe3fed0b143ef6bf2d9b65ce05d55aba4224429e (patch) | |
tree | 45ead8f324a1e5190ea4905cb574325a3d9196bd /libavformat/ftp.c | |
parent | 1dba8371d93cf1c83bcd5c432d921905206a60f3 (diff) |
Update demuxers and protocols for protocol whitelist support
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/ftp.c')
-rw-r--r-- | libavformat/ftp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/ftp.c b/libavformat/ftp.c index 4526dd73a0..c2a60f6115 100644 --- a/libavformat/ftp.c +++ b/libavformat/ftp.c @@ -537,8 +537,9 @@ static int ftp_connect_control_connection(URLContext *h) if (s->rw_timeout != -1) { av_dict_set_int(&opts, "timeout", s->rw_timeout, 0); } /* if option is not given, don't pass it and let tcp use its own default */ - err = ffurl_open(&s->conn_control, buf, AVIO_FLAG_READ_WRITE, - &h->interrupt_callback, &opts); + err = ffurl_open_whitelist(&s->conn_control, buf, AVIO_FLAG_READ_WRITE, + &h->interrupt_callback, &opts, + h->protocol_whitelist); av_dict_free(&opts); if (err < 0) { av_log(h, AV_LOG_ERROR, "Cannot open control connection\n"); @@ -590,8 +591,9 @@ static int ftp_connect_data_connection(URLContext *h) if (s->rw_timeout != -1) { av_dict_set_int(&opts, "timeout", s->rw_timeout, 0); } /* if option is not given, don't pass it and let tcp use its own default */ - err = ffurl_open(&s->conn_data, buf, h->flags, - &h->interrupt_callback, &opts); + err = ffurl_open_whitelist(&s->conn_data, buf, h->flags, + &h->interrupt_callback, &opts, + h->protocol_whitelist); av_dict_free(&opts); if (err < 0) return err; @@ -1114,4 +1116,5 @@ URLProtocol ff_ftp_protocol = { .url_delete = ftp_delete, .url_move = ftp_move, .flags = URL_PROTOCOL_FLAG_NETWORK, + .default_whitelist = "tcp", }; |