mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-24 02:09:03 +03:00
avformat/ftp: end a directory listing when the data connection ends
ffurl_read() reports the end of the data with AVERROR_EOF, which ftp_read_dir() passed on as an error instead of ending the listing. Fixes: avio_list_dir on a directory served by pyftpdlib 2.0.1 Assisted-by: Claude
This commit is contained in:
committed by
michaelni
parent
ab3ebee9ea
commit
45f34b7dfe
@@ -1071,9 +1071,9 @@ static int ftp_read_dir(URLContext *h, AVIODirEntry **next)
|
||||
if (s->dir_buffer_size)
|
||||
memmove(s->dir_buffer, start, s->dir_buffer_size);
|
||||
ret = ffurl_read(s->conn_data, s->dir_buffer + s->dir_buffer_size, DIR_BUFFER_SIZE - (s->dir_buffer_size + 1));
|
||||
if (ret < 0)
|
||||
if (ret < 0 && ret != AVERROR_EOF)
|
||||
return ret;
|
||||
if (!ret) {
|
||||
if (ret <= 0) {
|
||||
*next = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user