Commit 6f087f54 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove net_ReadNonBlock(),

it was merely a slower (and buggier) recv() nowadays.
parent 5a605a9f
...@@ -127,9 +127,6 @@ struct virtual_socket_t ...@@ -127,9 +127,6 @@ struct virtual_socket_t
#define net_Read(a,b,c,d,e,f) __net_Read(VLC_OBJECT(a),b,c,d,e,f) #define net_Read(a,b,c,d,e,f) __net_Read(VLC_OBJECT(a),b,c,d,e,f)
VLC_EXPORT( ssize_t, __net_Read, ( vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, size_t i_data, vlc_bool_t b_retry ) ); VLC_EXPORT( ssize_t, __net_Read, ( vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, size_t i_data, vlc_bool_t b_retry ) );
#define net_ReadNonBlock(a,b,c,d,e) __net_ReadNonBlock(VLC_OBJECT(a),b,c,d,e)
VLC_EXPORT( ssize_t, __net_ReadNonBlock, ( vlc_object_t *p_this, int fd, const v_socket_t *, uint8_t *p_data, size_t i_data ) );
#define net_Select(a,b,c,d,e) __net_Select(VLC_OBJECT(a),b,c,d,e) #define net_Select(a,b,c,d,e) __net_Select(VLC_OBJECT(a),b,c,d,e)
VLC_EXPORT( ssize_t, __net_Select, ( vlc_object_t *p_this, const int *pi_fd, int i_fd, uint8_t *p_data, size_t i_data ) ); VLC_EXPORT( ssize_t, __net_Select, ( vlc_object_t *p_this, const int *pi_fd, int i_fd, uint8_t *p_data, size_t i_data ) );
......
...@@ -650,8 +650,7 @@ static void NetCommand( sout_stream_t *p_stream ) ...@@ -650,8 +650,7 @@ static void NetCommand( sout_stream_t *p_stream )
{ {
sout_stream_sys_t *p_sys = p_stream->p_sys; sout_stream_sys_t *p_sys = p_stream->p_sys;
char psz_buffer[11]; char psz_buffer[11];
int i_len = net_ReadNonBlock( p_stream, p_sys->i_fd, NULL, (uint8_t *)&psz_buffer[0], int i_len = recv( p_sys->i_fd, psz_buffer, sizeof( psz_buffer ) - 1, 0 );
sizeof( psz_buffer ) - 1 );
if ( i_len > 0 ) if ( i_len > 0 )
{ {
......
...@@ -638,9 +638,8 @@ static char *SDPGenerate( sap_handler_t *p_sap, ...@@ -638,9 +638,8 @@ static char *SDPGenerate( sap_handler_t *p_sap,
static int CalculateRate( sap_handler_t *p_sap, sap_address_t *p_address ) static int CalculateRate( sap_handler_t *p_sap, sap_address_t *p_address )
{ {
int i_read;
uint8_t buffer[SAP_MAX_BUFFER]; uint8_t buffer[SAP_MAX_BUFFER];
int i_tot = 0; ssize_t i_tot = 0;
mtime_t i_temp; mtime_t i_temp;
int i_rate; int i_rate;
...@@ -649,13 +648,14 @@ static int CalculateRate( sap_handler_t *p_sap, sap_address_t *p_address ) ...@@ -649,13 +648,14 @@ static int CalculateRate( sap_handler_t *p_sap, sap_address_t *p_address )
p_address->t1 = mdate(); p_address->t1 = mdate();
return VLC_SUCCESS; return VLC_SUCCESS;
} }
do for (;;)
{ {
/* Might be too slow if we have huge data */ /* Might be too slow if we have huge data */
i_read = net_ReadNonBlock( p_sap, p_address->i_rfd, NULL, buffer, ssize_t i_read = recv( p_address->i_rfd, buffer, SAP_MAX_BUFFER, 0 );
SAP_MAX_BUFFER ); if (i_read == -1)
break;
i_tot += i_read; i_tot += i_read;
} while( i_read > 0 ); }
i_temp = mdate(); i_temp = mdate();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment