Setting the pointer to NULL inside both ftp_send_command
and ftp_features is redundant. Generally always setting to
NULL in ftp_send_command seems safer, but throughout the file
that parameter was always passed initialized. So I do it here
too for consistency.
Should fix CID1231988 (RESOURCE_LEAK)
OKed-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
Most FTP servers enable UTF-8 by default, but it is not required by the standard.
Enabling it manually makes ffmpeg implementation more consistent when server
doesn't enable it by default.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
FTP protocol used interrupt callback to simulate nonblock
operation which is a misuse of this callback.
This commit make FTP protocol fully blocking and removes
invalid usage of interrutp callback
Also adds support for multiline responses delimited with dashes
554 is possible invalid code:
- Restart not valid
- Command terminated due to server shutdown in progress
- etc...
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
It seems some ftp servers doesn't respect ABOR command,
but closing both connection is slow.
This commit keeps control connection open when possible.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
This commit reconnect both connections and retries before ftp_read returns an error.
Practical use case: resume after lock screen on iOS devices.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
ABOR command usually takes long (FTP server implementation dependent).
It also produces different response codes from different servers.
It is save for ffmpeg to reconnect both connection during seek for two reasons:
1. Alreay mentioned heavy manner of ABOR command.
2. Server may disconnected due to no transfer (seek after a long pause in ffmpeg client)
Reimplementation of ftp_status function.
New version requires explicit list of expected codes.
It flush data connection input before sending a command
and blocks until expected result appears.
Both strtoll and atoll have different names on MSVC, and strtoll has a
compatibility layer in place for this case.
Fixes compilation on MSVC.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>