Changeset 6f087f5478c208c71e3c6c878a28729f28f3b65e

Show
Ignore:
Timestamp:
02/26/07 17:38:21 (2 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1172507901 +0000
git-parent:

[5a605a9ff03e5266b56991d969c8c23f4e303906]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1172507901 +0000
Message:

Remove net_ReadNonBlock(),
it was merely a slower (and buggier) recv() nowadays.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_network.h

    rf9279bb r6f087f5  
    128128VLC_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 ) ); 
    129129 
    130 #define net_ReadNonBlock(a,b,c,d,e) __net_ReadNonBlock(VLC_OBJECT(a),b,c,d,e) 
    131 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 ) ); 
    132  
    133130#define net_Select(a,b,c,d,e) __net_Select(VLC_OBJECT(a),b,c,d,e) 
    134131VLC_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 ) ); 
  • modules/stream_out/switcher.c

    r6b382b4 r6f087f5  
    651651    sout_stream_sys_t *p_sys = p_stream->p_sys; 
    652652    char psz_buffer[11]; 
    653     int i_len = net_ReadNonBlock( p_stream, p_sys->i_fd, NULL, (uint8_t *)&psz_buffer[0], 
    654                                   sizeof( psz_buffer ) - 1 ); 
     653    int i_len = recv( p_sys->i_fd, psz_buffer, sizeof( psz_buffer ) - 1, 0 ); 
    655654 
    656655    if ( i_len > 0 ) 
  • src/stream_output/sap.c

    r6b382b4 r6f087f5  
    639639static int CalculateRate( sap_handler_t *p_sap, sap_address_t *p_address ) 
    640640{ 
    641     int i_read; 
    642641    uint8_t buffer[SAP_MAX_BUFFER]; 
    643     int i_tot = 0; 
     642    ssize_t i_tot = 0; 
    644643    mtime_t i_temp; 
    645644    int i_rate; 
     
    650649        return VLC_SUCCESS; 
    651650    } 
    652     do 
     651    for (;;) 
    653652    { 
    654653        /* Might be too slow if we have huge data */ 
    655         i_read = net_ReadNonBlock( p_sap, p_address->i_rfd, NULL, buffer, 
    656                                    SAP_MAX_BUFFER ); 
     654        ssize_t i_read = recv( p_address->i_rfd, buffer, SAP_MAX_BUFFER, 0 ); 
     655        if (i_read == -1) 
     656            break; 
    657657        i_tot += i_read; 
    658     } while( i_read > 0 ); 
     658    } 
    659659 
    660660    i_temp = mdate();