Ignore:
Timestamp:
Dec 28, 2016 3:40:07 AM (7 years ago)
Author:
nanang
Message:

Re #1900: More merged from trunk (r5512 mistakenly contains merged changes in third-party dir only).

Location:
pjproject/branches/projects/uwp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/uwp

  • pjproject/branches/projects/uwp/pjsip/src/pjsua-lib/pjsua_pres.c

    r4713 r5513  
    250250 
    251251    /* contact */ 
    252     info->contact.ptr = info->buf_ + total; 
    253     pj_strncpy(&info->contact, &buddy->contact, sizeof(info->buf_)-total); 
    254     total += info->contact.slen; 
     252    if (total < sizeof(info->buf_)) { 
     253        info->contact.ptr = info->buf_ + total; 
     254        pj_strncpy(&info->contact, &buddy->contact, sizeof(info->buf_) - total); 
     255        total += info->contact.slen; 
     256    } else { 
     257        info->contact = pj_str(""); 
     258    } 
    255259 
    256260    /* Presence status */ 
     
    552556        return status; 
    553557 
    554     PJ_LOG(4,(THIS_FILE, "Buddy %d: unsubscribing presence..", buddy_id)); 
    555558    pj_log_push_indent(); 
    556559 
     
    852855 
    853856    /* Create UAS dialog: */ 
    854     status = pjsip_dlg_create_uas(pjsip_ua_instance(), rdata,  
    855                                   &contact, &dlg); 
     857    status = pjsip_dlg_create_uas_and_inc_lock(pjsip_ua_instance(), rdata, 
     858                                               &contact, &dlg); 
    856859    if (status != PJ_SUCCESS) { 
    857860        pjsua_perror(THIS_FILE,  
     
    918921        } 
    919922 
     923        pjsip_dlg_dec_lock(dlg); 
    920924        PJSUA_UNLOCK(); 
    921925        pj_log_pop_indent(); 
    922926        return PJ_TRUE; 
    923927    } 
     928 
     929    /* Subscription has been created, decrement & release dlg lock */ 
     930    pjsip_dlg_dec_lock(dlg); 
    924931 
    925932    /* If account is locked to specific transport, then lock dialog 
     
    10321039 
    10331040    /* Done: */ 
    1034  
    10351041    PJSUA_UNLOCK(); 
    10361042    pj_log_pop_indent(); 
Note: See TracChangeset for help on using the changeset viewer.