Changeset e943c0003a271fce0c342fea521cdd7e2e5e3b27

Show
Ignore:
Timestamp:
09/09/07 22:13:17 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1189368797 +0000
git-parent:

[bd598bbab08a0c207c931f3deac82b649fd8f6ca]

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

Remove UDP-Lite support from access_output_udp.
If someone wants to have it in there, it should probably rather be done
using a dedicated shortcut rather than a boolean configuration.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access_output/udp.c

    rcd1ad0c re943c00  
    5050#include <vlc_network.h> 
    5151 
    52 #if defined (HAVE_NETINET_UDPLITE_H) 
    53 # include <netinet/udplite.h> 
    54 #elif defined (__linux__) 
    55 # define UDPLITE_SEND_CSCOV     10 
    56 # define UDPLITE_RECV_CSCOV     11 
    57 #endif 
    58  
    59 #ifndef IPPROTO_UDPLITE 
    60 # define IPPROTO_UDPLITE 136 /* from IANA */ 
    61 #endif 
    62 #ifndef SOL_UDPLITE 
    63 # define SOL_UDPLITE IPPROTO_UDPLITE 
    64 #endif 
    65  
    6652#define MAX_EMPTY_BLOCKS 200 
    6753 
     
    9985#define AUTO_MCAST_LONGTEXT N_("Allocates an outbound multicast address " \ 
    10086                               "automatically.") 
    101 #define UDPLITE_TEXT N_("UDP-Lite") 
    102 #define UDPLITE_LONGTEXT N_("Use UDP-Lite/IP instead of normal UDP/IP") 
    103 #define CSCOV_TEXT N_("Checksum coverage") 
    104 #define CSCOV_LONGTEXT N_("Payload bytes covered by layer-4 checksum") 
    10587 
    10688vlc_module_begin(); 
     
    11698    add_bool( SOUT_CFG_PREFIX "auto-mcast", VLC_FALSE, NULL, AUTO_MCAST_TEXT, 
    11799              AUTO_MCAST_LONGTEXT, VLC_TRUE ); 
    118     add_bool( SOUT_CFG_PREFIX "udplite", VLC_FALSE, NULL, UDPLITE_TEXT, UDPLITE_LONGTEXT, VLC_TRUE ); 
    119     add_integer( SOUT_CFG_PREFIX "cscov", 12, NULL, CSCOV_TEXT, CSCOV_LONGTEXT, VLC_TRUE ); 
    120100 
    121101    set_capability( "sout access", 100 ); 
     
    132112    "caching", 
    133113    "group", 
    134     "lite", 
    135     "cscov", 
    136114    NULL 
    137115}; 
     
    192170 
    193171    char                *psz_dst_addr = NULL; 
    194     int                 i_dst_port, proto = IPPROTO_UDP; 
    195     const char          *protoname = "UDP"; 
     172    int                 i_dst_port; 
    196173 
    197174    int                 i_handle; 
     
    216193    } 
    217194    p_access->p_sys = p_sys; 
    218  
    219     if (var_GetBool (p_access, SOUT_CFG_PREFIX"lite")) 
    220     { 
    221         protoname = "UDP-Lite"; 
    222         proto = IPPROTO_UDPLITE; 
    223     } 
    224195 
    225196    i_dst_port = DEFAULT_PORT; 
     
    262233    p_sys->p_thread->p_empty_blocks = block_FifoNew( p_access ); 
    263234 
    264     i_handle = net_ConnectDgram( p_this, psz_dst_addr, i_dst_port, -1, proto ); 
     235    i_handle = net_ConnectDgram( p_this, psz_dst_addr, i_dst_port, -1, 
     236                                 IPPROTO_UDP ); 
    265237    free (psz_dst_addr); 
    266238 
    267239    if( i_handle == -1 ) 
    268240    { 
    269          msg_Err( p_access, "failed to create %s socket", protoname ); 
     241         msg_Err( p_access, "failed to create raw UDP socket" ); 
    270242         vlc_object_destroy (p_sys->p_thread); 
    271243         free (p_sys); 
     
    293265    p_sys->p_thread->i_handle = i_handle; 
    294266    shutdown( i_handle, SHUT_RD ); 
    295  
    296     int cscov = var_GetInteger (p_access, SOUT_CFG_PREFIX"cscov"); 
    297     if (cscov) 
    298     { 
    299         switch (proto) 
    300         { 
    301 #ifdef UDPLITE_SEND_CSCOV 
    302             case IPPROTO_UDPLITE: 
    303                 cscov += 8; 
    304                 setsockopt (i_handle, SOL_UDPLITE, UDPLITE_SEND_CSCOV, 
    305                             &(int){ cscov }, sizeof (cscov)); 
    306                 break; 
    307 #endif 
    308 #ifdef DCCP_SOCKOPT_RECV_CSCOV 
    309             /* FIXME: ^^is this the right name ? */ 
    310             /* FIXME: is this inherited by accept() ? */ 
    311             case IPPROTO_DCCP: 
    312                 cscov = ((cscov + 3) >> 2) + 1; 
    313                 if (cscov > 15) 
    314                     break; /* out of DCCP cscov range */ 
    315                 setsockopt (i_handle, SOL_DCCP, DCCP_SOCKOPT_RECV_CSCOV, 
    316                             &(int){ cscov }, sizeof (cscov)); 
    317                 break; 
    318 #endif 
    319         } 
    320     } 
    321267 
    322268    p_sys->p_thread->i_caching =