patch: add sip_auth_reset()

This commit is contained in:
Alfred E. Heggestad 2011-01-04 10:40:07 +00:00
parent d06cbd18c3
commit ec3863310f
3 changed files with 14 additions and 0 deletions

View file

@ -282,6 +282,7 @@ void sip_reply_addr(struct sa *addr, const struct sip_msg *msg, bool rport);
int sip_auth_authenticate(struct sip_auth *auth, const struct sip_msg *msg);
int sip_auth_alloc(struct sip_auth **authp, sip_auth_h *authh,
void *arg, bool ref);
void sip_auth_reset(struct sip_auth *auth);
/* dialog */

View file

@ -285,3 +285,12 @@ int sip_auth_alloc(struct sip_auth **authp, sip_auth_h *authh,
return 0;
}
void sip_auth_reset(struct sip_auth *auth)
{
if (!auth)
return;
list_flush(&auth->realml);
}

View file

@ -168,6 +168,10 @@ static void response_handler(int err, const struct sip_msg *msg, void *arg)
return;
case 403:
sip_auth_reset(reg->auth);
break;
case 423:
minexp = sip_msg_hdr(msg, SIP_HDR_MIN_EXPIRES);
if (!minexp || !pl_u32(&minexp->val) || !reg->expires)