|
|
@ -455,7 +455,7 @@ static int ftp_features(FTPContext *s) |
|
|
|
|
|
|
|
|
|
|
|
static int ftp_connect_control_connection(URLContext *h) |
|
|
|
static int ftp_connect_control_connection(URLContext *h) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char buf[CONTROL_BUFFER_SIZE], opts_format[20], *response = NULL; |
|
|
|
char buf[CONTROL_BUFFER_SIZE], *response = NULL; |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
AVDictionary *opts = NULL; |
|
|
|
AVDictionary *opts = NULL; |
|
|
|
FTPContext *s = h->priv_data; |
|
|
|
FTPContext *s = h->priv_data; |
|
|
@ -465,8 +465,7 @@ static int ftp_connect_control_connection(URLContext *h) |
|
|
|
ff_url_join(buf, sizeof(buf), "tcp", NULL, |
|
|
|
ff_url_join(buf, sizeof(buf), "tcp", NULL, |
|
|
|
s->hostname, s->server_control_port, NULL); |
|
|
|
s->hostname, s->server_control_port, NULL); |
|
|
|
if (s->rw_timeout != -1) { |
|
|
|
if (s->rw_timeout != -1) { |
|
|
|
snprintf(opts_format, sizeof(opts_format), "%d", s->rw_timeout); |
|
|
|
av_dict_set_int(&opts, "timeout", s->rw_timeout, 0); |
|
|
|
av_dict_set(&opts, "timeout", opts_format, 0); |
|
|
|
|
|
|
|
} /* if option is not given, don't pass it and let tcp use its own default */ |
|
|
|
} /* 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, |
|
|
|
err = ffurl_open(&s->conn_control, buf, AVIO_FLAG_READ_WRITE, |
|
|
|
&h->interrupt_callback, &opts); |
|
|
|
&h->interrupt_callback, &opts); |
|
|
@ -505,7 +504,7 @@ static int ftp_connect_control_connection(URLContext *h) |
|
|
|
static int ftp_connect_data_connection(URLContext *h) |
|
|
|
static int ftp_connect_data_connection(URLContext *h) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
char buf[CONTROL_BUFFER_SIZE], opts_format[20]; |
|
|
|
char buf[CONTROL_BUFFER_SIZE]; |
|
|
|
AVDictionary *opts = NULL; |
|
|
|
AVDictionary *opts = NULL; |
|
|
|
FTPContext *s = h->priv_data; |
|
|
|
FTPContext *s = h->priv_data; |
|
|
|
|
|
|
|
|
|
|
@ -519,8 +518,7 @@ static int ftp_connect_data_connection(URLContext *h) |
|
|
|
/* Open data connection */ |
|
|
|
/* Open data connection */ |
|
|
|
ff_url_join(buf, sizeof(buf), "tcp", NULL, s->hostname, s->server_data_port, NULL); |
|
|
|
ff_url_join(buf, sizeof(buf), "tcp", NULL, s->hostname, s->server_data_port, NULL); |
|
|
|
if (s->rw_timeout != -1) { |
|
|
|
if (s->rw_timeout != -1) { |
|
|
|
snprintf(opts_format, sizeof(opts_format), "%d", s->rw_timeout); |
|
|
|
av_dict_set_int(&opts, "timeout", s->rw_timeout, 0); |
|
|
|
av_dict_set(&opts, "timeout", opts_format, 0); |
|
|
|
|
|
|
|
} /* if option is not given, don't pass it and let tcp use its own default */ |
|
|
|
} /* 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, |
|
|
|
err = ffurl_open(&s->conn_data, buf, h->flags, |
|
|
|
&h->interrupt_callback, &opts); |
|
|
|
&h->interrupt_callback, &opts); |
|
|
|