Changeset 871 for pjproject/trunk
- Timestamp:
- Dec 29, 2006 12:13:10 AM (18 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_auth.h
r695 r871 114 114 pj_bool_t is_proxy; /**< Server type (401/407) */ 115 115 pjsip_auth_qop_type qop_value; /**< qop required by server. */ 116 unsigned stale_cnt; /**< Number of stale retry. */ 116 117 #if PJSIP_AUTH_QOP_SUPPORT 117 118 pj_uint32_t nc; /**< Nonce count. */ -
pjproject/trunk/pjsip/include/pjsip/sip_config.h
r862 r871 410 410 411 411 /** 412 * Maximum number of stale retries when server keeps rejecting our request 413 * with stale=true. 414 */ 415 #ifndef PJSIP_MAX_STALE_COUNT 416 # define PJSIP_MAX_STALE_COUNT 3 417 #endif 418 419 420 /** 412 421 * @} 413 422 */ -
pjproject/trunk/pjsip/include/pjsip/sip_errno.h
r861 r871 362 362 */ 363 363 #define PJSIP_EAUTHINVALIDDIGEST (PJSIP_ERRNO_START_PJSIP+110) /* 171110 */ 364 /** 365 * @hideinitializer 366 * Maximum number of stale retries exceeded. This happens when server 367 * keeps rejecting our authorization request with stale=true. 368 */ 369 #define PJSIP_EAUTHSTALECOUNT (PJSIP_ERRNO_START_PJSIP + 111) /* 171111 */ 364 370 365 371 -
pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c
r696 r871 44 44 #endif 45 45 46 46 47 /* Transform digest to string. 47 48 * output must be at least PJSIP_MD5STRLEN+1 bytes. … … 600 601 auth = sess->cached_auth.next; 601 602 while (auth != &sess->cached_auth) { 603 /* Reset stale counter */ 604 auth->stale_cnt = 0; 605 602 606 if (auth->qop_value == PJSIP_AUTH_QOP_NONE) { 603 607 # if defined(PJSIP_AUTH_HEADER_CACHING) && \ … … 708 712 * the same credential. 709 713 */ 710 PJ_LOG(4, (THIS_FILE, "Authorization failed for %.*s@%.*s", 714 PJ_LOG(4, (THIS_FILE, "Authorization failed for %.*s@%.*s: " 715 "server rejected with stale=false", 711 716 sent_auth->credential.digest.username.slen, 712 717 sent_auth->credential.digest.username.ptr, … … 714 719 sent_auth->credential.digest.realm.ptr)); 715 720 return PJSIP_EFAILEDCREDENTIAL; 721 } 722 723 cached_auth->stale_cnt++; 724 if (cached_auth->stale_cnt >= PJSIP_MAX_STALE_COUNT) { 725 /* Our credential is rejected. No point in trying to re-supply 726 * the same credential. 727 */ 728 PJ_LOG(4, (THIS_FILE, "Authorization failed for %.*s@%.*s: " 729 "maximum number of stale retries exceeded", 730 sent_auth->credential.digest.username.slen, 731 sent_auth->credential.digest.username.ptr, 732 sent_auth->credential.digest.realm.slen, 733 sent_auth->credential.digest.realm.ptr)); 734 return PJSIP_EAUTHSTALECOUNT; 716 735 } 717 736 -
pjproject/trunk/pjsip/src/pjsip/sip_errno.c
r861 r871 100 100 PJ_BUILD_ERR( PJSIP_EAUTHINVALIDREALM, "Invalid authorization realm"), 101 101 PJ_BUILD_ERR( PJSIP_EAUTHINVALIDDIGEST,"Invalid authorization digest" ), 102 PJ_BUILD_ERR( PJSIP_EAUTHSTALECOUNT, "Maximum number of stale retries exceeded"), 102 103 103 104 /* UA/dialog layer. */
Note: See TracChangeset
for help on using the changeset viewer.