diff options
author | Lukasz Marek <lukasz.m.luki@gmail.com> | 2013-07-17 04:37:15 +0400 |
---|---|---|
committer | Lukasz Marek <lukasz.m.luki@gmail.com> | 2013-07-17 16:42:20 +0400 |
commit | 816c579cf3cbd079c1b14aaa063b61eed4c555ad (patch) | |
tree | 03b6d24a27c5d80395267f8423970fd61aaf47b3 /libavformat/ftp.c | |
parent | 2217243e1234c87ec2e059bf627a86e15dbe1b28 (diff) |
ftp: warning about pure-ftp server used as and output
Diffstat (limited to 'libavformat/ftp.c')
-rw-r--r-- | libavformat/ftp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/ftp.c b/libavformat/ftp.c index 5241b13b83..1a4708109b 100644 --- a/libavformat/ftp.c +++ b/libavformat/ftp.c @@ -382,7 +382,7 @@ static int ftp_restart(FTPContext *s, int64_t pos) static int ftp_connect_control_connection(URLContext *h) { - char buf[CONTROL_BUFFER_SIZE], opts_format[20]; + char buf[CONTROL_BUFFER_SIZE], opts_format[20], *response = NULL; int err; AVDictionary *opts = NULL; FTPContext *s = h->priv_data; @@ -404,11 +404,16 @@ static int ftp_connect_control_connection(URLContext *h) } /* check if server is ready */ - if (ftp_status(s, NULL, connect_codes) != 220) { + if (ftp_status(s, ((h->flags & AVIO_FLAG_WRITE) ? &response : NULL), connect_codes) != 220) { av_log(h, AV_LOG_ERROR, "FTP server not ready for new users\n"); return AVERROR(EACCES); } + if ((h->flags & AVIO_FLAG_WRITE) && av_stristr(response, "pure-ftpd")) { + av_log(h, AV_LOG_WARNING, "Pure-FTPd server is used as an output protocol. It is known issue this implementation may produce incorrect content and it cannot be fixed at this moment."); + } + av_free(response); + if ((err = ftp_auth(s)) < 0) { av_log(h, AV_LOG_ERROR, "FTP authentication failed\n"); return err; |