Dec 8, 2009 1:11:25 PM (13 years ago)

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.

1 edited


  • pjproject/trunk/pjnath/include/pjnath/turn_session.h

    r2642 r3028  
    456456 * 
    457457 * @param sess          The TURN client session. 
     458 * @param last_err      Optional error code to be set to the session, 
     459 *                      which would be returned back in the \a info 
     460 *                      parameter of #pj_turn_session_get_info(). If 
     461 *                      this argument value is PJ_SUCCESS, the error 
     462 *                      code will not be set. If the session already 
     463 *                      has an error code set, this function will not 
     464 *                      overwrite that error code either. 
    458465 * 
    459466 * @return              PJ_SUCCESS if the operation has been successful, 
    460467 *                      or the appropriate error code on failure. 
    461468 */ 
    462 PJ_DECL(pj_status_t) pj_turn_session_destroy(pj_turn_session *sess); 
     469PJ_DECL(pj_status_t) pj_turn_session_destroy(pj_turn_session *sess, 
     470                                             pj_status_t last_err); 
Note: See TracChangeset for help on using the changeset viewer.