Ignore:
Timestamp:
Dec 8, 2009 1:11:25 PM (14 years ago)
Author:
bennylp
Message:

Fixed ticket #999:

Several bug fixes to the TURN client library and icedemo sample application:

  1. ICE stream transport reports ICE initialization/candidate gathering stage as successful even when TURN client TCP connection has failed.
  2. Bad ChannelData? framing when TCP is used. PJNATH did not properly add padding to the TURN ChannelData? packet if TCP is used and the data is not aligned to four bytes boundary. Similarly incoming ChannelData? with padding (over TCP) may not be handled correctly.
  3. Incoming data over TCP may be delayed. PJNATH only processed one frame (be it request, indication, or ChannelData?) on an incoming stream, so if the stream contains more than one frames, the processing of subsequent frames will be delayed until more stream is received on the TCP transport.
  4. The icedemo sample application overwrites the incoming packet buffer with NULL character ('\0') before printing the message to console. If there is another packet after current packet (as often happens when TCP is used), the subsequent packet will get corrupted.

The combinations of bugs above may cause PJNATH to return "Invalid STUN message length (PJNATH_EINSTUNMSGLEN)" error when processing incoming TURN ChannelData? message over TCP.

And a small enhancement:

  1. Add logging to file option to icedemo sample.

Thanks Sarun Nandakumar for the report.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/ice_strans.c

    r2966 r3028  
    913913 
    914914/* 
     915 * Get number of candidates 
     916 */ 
     917PJ_DEF(unsigned) pj_ice_strans_get_cands_count(pj_ice_strans *ice_st, 
     918                                               unsigned comp_id) 
     919{ 
     920    unsigned i, cnt; 
     921 
     922    PJ_ASSERT_RETURN(ice_st && ice_st->ice && comp_id &&  
     923                     comp_id <= ice_st->comp_cnt, 0); 
     924 
     925    cnt = 0; 
     926    for (i=0; i<ice_st->ice->lcand_cnt; ++i) { 
     927        if (ice_st->ice->lcand[i].comp_id != comp_id) 
     928            continue; 
     929        ++cnt; 
     930    } 
     931 
     932    return cnt; 
     933} 
     934 
     935/* 
    915936 * Enum candidates 
    916937 */ 
Note: See TracChangeset for help on using the changeset viewer.