[vlc-commits] adaptive: remove nonsensical extra send() call

Rémi Denis-Courmont git at videolan.org
Tue May 12 21:25:02 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue May 12 22:11:39 2015 +0300| [fcef71a71a633c6b8ae8357f338257b7ac3f2406] | committer: Rémi Denis-Courmont

adaptive: remove nonsensical extra send() call

If net_Write() returns a short count, send() is not going to help. It
means the connection was closed.

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

 modules/demux/adaptative/http/Sockets.cpp |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/modules/demux/adaptative/http/Sockets.cpp b/modules/demux/adaptative/http/Sockets.cpp
index 00d67ea..ea46e6b 100644
--- a/modules/demux/adaptative/http/Sockets.cpp
+++ b/modules/demux/adaptative/http/Sockets.cpp
@@ -86,14 +86,7 @@ bool Socket::send(vlc_object_t *stream, const void *buf, size_t size)
     if (size == 0)
         return true;
 
-    ssize_t ret = net_Write(stream, netfd, NULL, buf, size);
-    if (ret <= 0)
-        return false;
-
-    if ( (size_t)ret < size )
-        send( stream, ((uint8_t*)buf) + ret, size - ret );
-
-    return true;
+    return net_Write(stream, netfd, NULL, buf, size) == (ssize_t)size;
 }
 
 TLSSocket::TLSSocket() : Socket()



More information about the vlc-commits mailing list