Commit Graph

45 Commits

Author SHA1 Message Date
Clément Bœsch
43ecec0f03 avformat: use AV_OPT_TYPE_BOOL in a bunch of places 2015-12-04 15:43:33 +01:00
Ganesh Ajjanagadde
ecf6b26aa5 avformat/ftp: use correct enum type
Fixes -Wenum-conversion from
http://fate.ffmpeg.org/report.cgi?time=20150820031140&slot=arm64-darwin-clang-apple-5.1

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-20 12:22:50 +02:00
Mariusz Szczepańczyk
bf5b2f9df8 lavf/ftp: implement move and delete callbacks
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-20 00:08:16 +02:00
Ronald S. Bultje
229843aa35 Replace av_dlog with ff_dlog.
ff_dlog checks compilability, and is non-public. av_dlog is deprecated
and no longer exists if FF_API_DLOG=0.
2015-08-18 10:24:01 -04:00
Mariusz Szczepańczyk
affbecb0de lavf/ftp: implement NLST method
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-14 01:00:11 +02:00
Michael Niedermayer
55a07cf49c avformat/ftp: Use av_freep() for dir_buffer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-10 18:46:38 +02:00
Mariusz Szczepańczyk
ee44cb3c81 lavf/ftp: properly read an empty path
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-10 18:23:40 +02:00
Lukasz Marek
bc93053161 lavf/ftp: implement directory listing callbacks
Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-10 18:23:35 +02:00
Lukasz Marek
cd3d0d5422 lavf/ftp: remove fixed length buffers from context
It saves some memory.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2015-04-03 00:10:09 +02:00
Lukasz Marek
c043def91f lavf/ftp: parse user and password once
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2015-04-03 00:09:54 +02:00
Alexander Strasser
db85d11d9d libavformat/ftp: Do not leak memory in routine ftp_features
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>
2014-08-26 00:52:29 +02:00
Reimar Döffinger
a0941c8a2b Use new av_dict_set_int helper function.
Get rid of the many, slightly differing, implementations
of basically the same thing.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-08-16 14:31:41 +02:00
Lukasz Marek
c82521713d lavf/ftp: always treat all response codes >= 500 as error
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-07-04 01:21:08 +02:00
Lukasz Marek
a0358db323 lavf/ftp: explicitly enable UTF-8
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>
2014-07-04 01:21:08 +02:00
Lukasz Marek
3ba6dce48d lavf/ftp: make response parsing more RFC compliant
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-07-04 01:21:08 +02:00
Lukasz Marek
b9419b5882 lavf/ftp: favour EPSV over PASV command
EPSV is newer version of PASV and allows to use IPv6.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-05-20 00:00:45 +02:00
Lukasz Marek
9f4b55ef49 lavf/ftp: fix seek to nagative position
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-28 00:07:31 +01:00
Lukasz Marek
9ef441c525 lavf/ftp: remove double space
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-22 00:41:13 +01:00
Lukasz Marek
3a92ee5953 avformat/ftp: add log regarding passive mode failure
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2013-10-12 13:52:33 +02:00
Lukasz Marek
e1fb3143bb avformat/ftp: fix possible deadlock
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2013-10-12 13:52:33 +02:00
Lukasz Marek
f3ace37a3b lavf/ftp: fix possible crash 2013-08-29 01:57:38 +02:00
Michael Niedermayer
535d9a9386 avformat/ftp: make const tables static const
Reviewed-by: Lukasz M <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-27 03:55:45 +02:00
Lukasz Marek
816c579cf3 ftp: warning about pure-ftp server used as and output 2013-07-17 14:42:20 +02:00
Lukasz Marek
2217243e12 ftp: comments 2013-07-17 14:42:20 +02:00
Lukasz Marek
db72b7742a ftp: remove unused headers 2013-07-17 14:42:20 +02:00
Lukasz Marek
247e658784 ftp: fix interrupt callback misuse
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
2013-07-17 14:42:20 +02:00
Lukasz Marek
ff35c7cdfa ftp: add invalid code for RETR operation
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>
2013-06-08 04:17:34 +02:00
Lukasz Marek
89b4800eef ftp: probe seek capability
Make FTP streamed when server doesn't accept REST command

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2013-06-08 04:17:34 +02:00
Lukasz Marek
eeedca4b7f ftp: fix seeking beyond file size
adjust to ff* tools seek nature

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2013-06-08 04:17:33 +02:00
Lukasz Marek
4d617715c9 ftp: abort function optimalization
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>
2013-06-08 04:17:26 +02:00
Lukasz Marek
bc29acdc76 ftp: explicit return code checks
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2013-06-08 03:54:55 +02:00
Lukasz Marek
43eda88200 ftp: fix flush control connection input
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2013-06-08 03:54:55 +02:00
Lukasz Marek
23a76b71de ftp: reconnect on tcp read error
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>
2013-06-08 03:54:55 +02:00
Lukasz Marek
7faafe606f ftp: fix using uninitialized value
Fix coverity issue CID 1026777

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2013-06-04 13:08:23 +02:00
Lukasz Marek
ddbcc48b64 ftp: enhanced error handling
Add error codes to expected codes to make responses faster.
Success of a command is validated by comparing code to a success code.
2013-05-31 16:54:03 +02:00
Lukasz Marek
34c423894c ftp: reconnect on seek
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)
2013-05-31 16:52:39 +02:00
Lukasz Marek
d99beeb70e ftp: move common commands code to function
Each send command routine requires the same steps.
This commit moves repeated code into one function.
2013-05-31 16:42:26 +02:00
Lukasz Marek
3f00521809 ftp: enhanced status code handling
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.
2013-05-31 16:42:25 +02:00
Lukasz Marek
1931c2d265 ftp: reconnect on read
FTP server may disconnect after some period of time when no transfer is done.

FTP protocol should reconnect and seek to last position.
2013-05-31 16:40:03 +02:00
Lukasz Marek
c84d6aa2f6 ftp: move create control connection to function
Move common code that opens control connection to function.
This code can be reused when reconnecting to FTP server
after inactivity.
2013-05-31 15:57:58 +02:00
Lukasz Marek
e46e49e31d ftp: credentials moved into FTPContext
FTP server may disconnect client.

This commit stores credentials for future reconnect.
2013-05-31 15:57:58 +02:00
Lukasz Marek
80cce899f6 ftp: rename function name
ftp_send_command was used only once.

This commit makes this function specific, not generic
2013-05-31 15:57:58 +02:00
Lukasz Marek
afa30e51d1 ftp: formatting and typos fixes 2013-05-31 15:57:57 +02:00
Hendrik Leppkes
df07a833f1 ftp: favor strtoll over atoll
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>
2013-05-19 10:02:44 +02:00
Lukasz Marek
c86d3a54de FTP protocol support
Implementation of ftp protocol.

Fixes #1672

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-18 22:16:02 +02:00