Ignore:
Timestamp:
Oct 7, 2009 8:42:28 AM (15 years ago)
Author:
bennylp
Message:

More #962: STUN compatibility problem with RFC 3489 servers (in encoding SERVER-NAME or SOFTWARE attribute):

Location:
pjproject/branches/adhocs/1.4.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/adhocs/1.4.5

  • pjproject/branches/adhocs/1.4.5/pjnath/src/pjnath/stun_msg.c

    r2922 r2929  
    12361236    PUTVAL16H(buf, 0, ca->hdr.type); 
    12371237 
    1238     /* Set the length to be 4-bytes aligned so that we can 
    1239      * communicate with RFC 3489 endpoints 
     1238    /* Special treatment for SOFTWARE attribute: 
     1239     * This attribute had caused interop problem when talking to  
     1240     * legacy RFC 3489 STUN servers, due to different "length" 
     1241     * rules with RFC 5389. 
    12401242     */ 
    1241     PUTVAL16H(buf, 2, (pj_uint16_t)((ca->value.slen + 3) & (~3))); 
     1243    if (msghdr->magic != PJ_STUN_MAGIC || 
     1244        ca->hdr.type == PJ_STUN_ATTR_SOFTWARE) 
     1245    { 
     1246        /* Set the length to be 4-bytes aligned so that we can 
     1247         * communicate with RFC 3489 endpoints 
     1248         */ 
     1249        PUTVAL16H(buf, 2, (pj_uint16_t)((ca->value.slen + 3) & (~3))); 
     1250    } else { 
     1251        /* Use RFC 5389 rule */ 
     1252        PUTVAL16H(buf, 2, (pj_uint16_t)ca->value.slen); 
     1253    } 
    12421254 
    12431255    /* Copy the string */ 
Note: See TracChangeset for help on using the changeset viewer.