]> git.sesse.net Git - vlc/commitdiff
Don't print an error message when attempting to recv returns EAGAIN
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 9 May 2005 19:01:25 +0000 (19:01 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 9 May 2005 19:01:25 +0000 (19:01 +0000)
(can only happens if we're using SSL and it is a not an error situation)

src/misc/net.c

index 40a276061009b8b5bba9a950759b57332fafbbf2..94c3df032272e85b4fcbc00363d01aeb252a614d 100644 (file)
@@ -441,6 +441,11 @@ int __net_Read( vlc_object_t *p_this, int fd, v_socket_t *p_vs,
               : recv( fd, p_data, i_data, 0 ) ) < 0 )
         {
 #if defined(WIN32) || defined(UNDER_CE)
+            if( WSAGetLastError() == WSAEWOULDBLOCK )
+            {
+                /* only happens with p_vs (SSL) - not really an error */
+            }
+            else
             /* For udp only */
             /* On win32 recv() will fail if the datagram doesn't fit inside
              * the passed buffer, even though the buffer will be filled with
@@ -454,7 +459,9 @@ int __net_Read( vlc_object_t *p_this, int fd, v_socket_t *p_vs,
             else
                 msg_Err( p_this, "recv failed (%i)", WSAGetLastError() );
 #else
-            msg_Err( p_this, "recv failed (%s)", strerror(errno) );
+            /* EAGAIN only happens with p_vs (SSL) and it's not an error */
+            if( errno != EAGAIN )
+                msg_Err( p_this, "recv failed (%s)", strerror(errno) );
 #endif
             return i_total > 0 ? i_total : -1;
         }