- if( i_ret < 0 && errno == EINTR )
- {
- return 0;
- }
- else if( i_ret < 0 )
- {
- msg_Err( p_this, "network selection error (%s)", strerror(errno) );
- return -1;
- }
- else if( i_ret == 0 )
- {
- return 0;
- }
- else
- {
- for( i = 0 ; i < i_fd ; i++)
- {
- if( FD_ISSET( pi_fd[i], &fds_r ) )
- {
- i_recv = ((pp_vs != NULL) && (pp_vs[i] != NULL))
- ? pp_vs[i]->pf_recv( pp_vs[i]->p_sys, p_data, i_data )
- : recv( pi_fd[i], p_data, i_data, 0 );
- if( i_recv < 0 )
- {
-#ifdef WIN32
- /* 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 the first part of the datagram. */
- if( WSAGetLastError() == WSAEMSGSIZE )
- {
- msg_Err( p_this, "recv() failed. "
- "Increase the mtu size (--mtu option)" );
- }
- else msg_Err( p_this, "recv failed (%i)",
- WSAGetLastError() );
-#else
- msg_Err( p_this, "recv failed (%s)", strerror(errno) );
-#endif
- return VLC_EGENERIC;
- }