Ignore:
Timestamp:
Feb 7, 2006 6:48:01 PM (18 years ago)
Author:
bennylp
Message:

Tested initial implementation: basic UAC, client registration, authentication, etc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c

    r127 r141  
    395395                                                    const pjsip_cred_info *c) 
    396396{ 
    397     PJ_ASSERT_RETURN(sess && cred_cnt && c, PJ_EINVAL); 
    398  
    399     sess->cred_info = pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c)); 
    400     pj_memcpy(sess->cred_info, c, cred_cnt * sizeof(*c)); 
    401     sess->cred_cnt = cred_cnt; 
     397    PJ_ASSERT_RETURN(sess && c, PJ_EINVAL); 
     398 
     399    if (cred_cnt == 0) { 
     400        sess->cred_cnt = 0; 
     401    } else { 
     402        sess->cred_info = pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c)); 
     403        pj_memcpy(sess->cred_info, c, cred_cnt * sizeof(*c)); 
     404        sess->cred_cnt = cred_cnt; 
     405    } 
    402406 
    403407    return PJ_SUCCESS; 
     
    522526            } 
    523527        } 
     528 
     529#       if defined(PJSIP_AUTH_AUTO_SEND_NEXT) && PJSIP_AUTH_AUTO_SEND_NEXT!=0 
     530            if (hdr != cached_auth->last_chal) { 
     531                cached_auth->last_chal = pjsip_hdr_clone(sess_pool, hdr); 
     532            } 
     533#       endif 
    524534    } 
    525535#   endif 
Note: See TracChangeset for help on using the changeset viewer.