Changeset 1906 for pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c
- Timestamp:
- Apr 2, 2008 8:34:05 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c
r1818 r1906 873 873 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)h); 874 874 } else { 875 enum { HDRLEN = 256 }; 876 const pj_str_t hname = pj_str("Authorization"); 877 pj_str_t hval; 878 pjsip_generic_string_hdr *hs; 879 char *hdr; 880 881 hdr = (char*)pj_pool_alloc(tdata->pool, HDRLEN); 882 len = pj_ansi_snprintf( 883 hdr, HDRLEN, 884 "%.*s username=\"%.*s\", realm=\"%.*s\"," 885 " nonce=\"\", uri=\"%s\",%s%.*s%s response=\"\"", 886 (int)c->scheme.slen, c->scheme.ptr, 887 (int)c->username.slen, c->username.ptr, 888 (int)c->realm.slen, c->realm.ptr, 889 uri_str, 890 (sess->pref.algorithm.slen ? " algorithm=" : ""), 891 (int)sess->pref.algorithm.slen, sess->pref.algorithm.ptr, 892 (sess->pref.algorithm.slen ? "," : "")); 893 894 PJ_ASSERT_RETURN(len>0 && len<HDRLEN, PJ_ETOOBIG); 895 896 hval.ptr = hdr; 897 hval.slen = len; 898 hs = pjsip_generic_string_hdr_create(tdata->pool, &hname, 899 &hval); 875 pjsip_authorization_hdr *hs; 876 877 hs = pjsip_authorization_hdr_create(tdata->pool); 878 pj_strdup(tdata->pool, &hs->scheme, &c->scheme); 879 pj_strdup(tdata->pool, &hs->credential.digest.username, 880 &c->username); 881 pj_strdup(tdata->pool, &hs->credential.digest.realm, 882 &c->realm); 883 pj_strdup2(tdata->pool, &hs->credential.digest.uri, 884 uri_str); 885 pj_strdup(tdata->pool, &hs->credential.digest.algorithm, 886 &sess->pref.algorithm); 887 900 888 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)hs); 901 889 }
Note: See TracChangeset
for help on using the changeset viewer.