[vlc-commits] ftp: return an error when file size is unknown

Rémi Denis-Courmont git at videolan.org
Mon Aug 31 17:45:06 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 31 18:35:35 2015 +0300| [d254fef41e4322477eb84d1392636eb54b424e4e] | committer: Rémi Denis-Courmont

ftp: return an error when file size is unknown

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d254fef41e4322477eb84d1392636eb54b424e4e
---

 modules/access/ftp.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index 7810985..06f3827 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -31,6 +31,7 @@
 #endif
 
 #include <assert.h>
+#include <stdint.h>
 #include <errno.h>
 
 #include <vlc_common.h>
@@ -631,7 +632,7 @@ static int InOpen( vlc_object_t *p_this )
         return VLC_ENOMEM;
     p_sys->data.fd = -1;
     p_sys->out = false;
-    p_sys->size = 0;
+    p_sys->size = UINT64_MAX;
     readTLSMode( p_sys, p_access->psz_access );
 
     if( parseURL( &p_sys->url, p_access->psz_location, p_sys->tlsmode ) )
@@ -939,6 +940,8 @@ static int Control( access_t *p_access, int i_query, va_list args )
             *pb_bool = true;    /* FIXME */
             break;
         case ACCESS_GET_SIZE:
+            if( p_access->p_sys->size == UINT64_MAX )
+                return VLC_EGENERIC;
             *va_arg( args, uint64_t * ) = p_access->p_sys->size;
             break;
 



More information about the vlc-commits mailing list