[vlc-commits] http: use vlc_recv_i11e() and add missing I/O error handling

Rémi Denis-Courmont git at videolan.org
Wed Jul 1 18:22:12 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jun 30 23:52:51 2015 +0300| [47d0940066b0b78e0f402484e85f8e296a23549f] | committer: Rémi Denis-Courmont

http: use vlc_recv_i11e() and add missing I/O error handling

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

 modules/access/http.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/access/http.c b/modules/access/http.c
index 4001438..195c59c 100644
--- a/modules/access/http.c
+++ b/modules/access/http.c
@@ -31,6 +31,8 @@
 # include "config.h"
 #endif
 
+#include <errno.h>
+
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_access.h>
@@ -43,6 +45,7 @@
 #include <vlc_charset.h>
 #include <vlc_input.h>
 #include <vlc_http.h>
+#include <vlc_interrupt.h>
 
 #ifdef HAVE_ZLIB_H
 #   include <zlib.h>
@@ -672,7 +675,9 @@ static int ReadData( access_t *p_access, int *pi_read,
     if( p_sys->p_tls != NULL )
         *pi_read = vlc_tls_Read( p_sys->p_tls, p_buffer, i_len, false );
     else
-        *pi_read = net_Read( p_access, p_sys->fd, p_buffer, i_len, false );
+        *pi_read = vlc_recv_i11e( p_sys->fd, p_buffer, i_len, 0 );
+    if( *pi_read < 0 && errno != EINTR && errno != EAGAIN )
+        return VLC_EGENERIC;
     if( *pi_read <= 0 )
         return VLC_SUCCESS;
 



More information about the vlc-commits mailing list