]> git.sesse.net Git - vlc/commitdiff
Comment on the EOF case - this does not change the semantic at all.
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 19 Nov 2007 18:28:24 +0000 (18:28 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 19 Nov 2007 18:28:24 +0000 (18:28 +0000)
src/network/io.c

index cfcec6b1f4f626a83ea3ab8e78a968916291790b..ee1ba969fa11e7839ef82d55623847086f5655bb 100644 (file)
@@ -333,6 +333,14 @@ net_ReadInner (vlc_object_t *restrict p_this, unsigned fdc, const int *fdv,
 #endif
         }
 
+        if (n == 0)
+            /* For streams, this means end of file, and there will not be any
+             * further data ever on the stream. For datagram sockets, this
+             * means empty datagram, and there could be more data coming.
+             * However, it makes no sense to set <waitall> with datagrams.
+             */
+            break; // EOF
+
         if (n == -1)
         {
 #if defined(WIN32) || defined(UNDER_CE)
@@ -367,7 +375,7 @@ net_ReadInner (vlc_object_t *restrict p_this, unsigned fdc, const int *fdv,
         p_buf += n;
         i_buflen -= n;
 
-        if ((n == 0) || !waitall)
+        if (!waitall)
             break;
     }
     return i_total;