Changeset 5237


Ignore:
Timestamp:
Jan 27, 2016 5:42:20 AM (5 years ago)
Author:
riza
Message:

Misc (Re #1882): When server sends blank realm on the Authentication challanges, the stack doesn't include the realm param.
And hence, the server will reject the request. This patch will include the blank realm on the next request.
Thanks to Keith Hanaway for the report.

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/print_util.h

    r4979 r5237  
    106106#define copy_advance_pair       copy_advance_pair_check 
    107107 
     108/* 
     109 * Append str1 and quoted str2 and copy to buf.  
     110 * No string is copied if str2 is empty. 
     111 */ 
    108112#define copy_advance_pair_quote_cond(buf,str1,len1,str2,quotebegin,quoteend) \ 
    109113        do {    \ 
     
    113117            copy_advance_pair(buf,str1,len1,str2); \ 
    114118        } while (0) 
     119 
     120/* 
     121 * Append str1 and quoted str2 and copy to buf.  
     122 * In case str2 is empty, str1 will be appended with empty quote. 
     123 */ 
     124#define copy_advance_pair_quote_cond_always(buf,str1,len1,str2,quotebegin, \ 
     125                                            quoteend)\ 
     126    do {        \ 
     127       if (!str2.slen) \ 
     128         copy_advance_pair_quote(buf,str1,len1,str2,quotebegin,quoteend); \ 
     129       else \ 
     130         copy_advance_pair_quote_cond(buf,str1,len1,str2,quotebegin,quoteend);\ 
     131    } while (0) 
    115132 
    116133/* 
  • pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c

    r4537 r5237  
    7272     
    7373    copy_advance_pair_quote_cond(buf, "username=", 9, cred->username, '"', '"'); 
    74     copy_advance_pair_quote_cond(buf, ", realm=", 8, cred->realm, '"', '"'); 
     74    copy_advance_pair_quote_cond_always(buf, ", realm=", 8, cred->realm, '"',  
     75                                        '"'); 
    7576    copy_advance_pair_quote(buf, ", nonce=", 8, cred->nonce, '"', '"'); 
    7677    copy_advance_pair_quote_cond(buf, ", uri=", 6, cred->uri, '"', '"'); 
Note: See TracChangeset for help on using the changeset viewer.