Ignore:
Timestamp:
Mar 9, 2008 11:52:48 PM (17 years ago)
Author:
bennylp
Message:

More ticket #485: initial (incomplete) work on TURN client session library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjturn-srv/allocation.c

    r1852 r1854  
    3939#define MAX_LIFETIME            600 
    4040#define DEF_LIFETIME            300 
    41  
    42  
    43  
    44 /* ChannelData header */ 
    45 typedef struct channel_data_hdr 
    46 { 
    47     pj_uint16_t ch_number; 
    48     pj_uint16_t length; 
    49 } channel_data_hdr; 
    5041 
    5142 
     
    913904         * This is not a STUN packet, must be ChannelData packet. 
    914905         */ 
    915         channel_data_hdr *cd = (channel_data_hdr*)pkt->pkt; 
     906        pj_turn_channel_data *cd = (pj_turn_channel_data*)pkt->pkt; 
    916907        pj_turn_permission *perm; 
    917908        pj_ssize_t len; 
     909 
     910        pj_assert(sizeof(*cd)==4); 
    918911 
    919912        /* For UDP check the packet length */ 
     
    979972    if (perm->channel != PJ_TURN_INVALID_CHANNEL) { 
    980973        /* Send ChannelData */ 
    981         channel_data_hdr *cd = (channel_data_hdr*)rel->tp.tx_pkt; 
     974        pj_turn_channel_data *cd = (pj_turn_channel_data*)rel->tp.tx_pkt; 
    982975 
    983976        if (len > PJ_TURN_MAX_PKT_LEN) { 
     
    995988 
    996989        /* Copy data */ 
    997         pj_memcpy(rel->tp.rx_pkt+sizeof(channel_data_hdr), pkt, len); 
     990        pj_memcpy(rel->tp.rx_pkt+sizeof(pj_turn_channel_data), pkt, len); 
    998991 
    999992        /* Send to client */ 
    1000993        pj_turn_listener_sendto(alloc->listener, rel->tp.tx_pkt, 
    1001                                len+sizeof(channel_data_hdr), 0, 
     994                               len+sizeof(pj_turn_channel_data), 0, 
    1002995                               &alloc->hkey.clt_addr, 
    1003996                               pj_sockaddr_get_len(&alloc->hkey.clt_addr)); 
Note: See TracChangeset for help on using the changeset viewer.