Ignore:
Timestamp:
Dec 28, 2016 3:40:07 AM (8 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-apps/src/samples/siprtp.c

    r5170 r5513  
    638638 
    639639    /* Create UAS dialog */ 
    640     status = pjsip_dlg_create_uas( pjsip_ua_instance(), rdata, 
    641                                    &app.local_contact, &dlg); 
     640    status = pjsip_dlg_create_uas_and_inc_lock( pjsip_ua_instance(), rdata, 
     641                                                &app.local_contact, &dlg); 
    642642    if (status != PJ_SUCCESS) { 
    643643        const pj_str_t reason = pj_str("Unable to create dialog"); 
     
    656656        pjsip_dlg_create_response(dlg, rdata, 500, NULL, &tdata); 
    657657        pjsip_dlg_send_response(dlg, pjsip_rdata_get_tsx(rdata), tdata); 
     658        pjsip_dlg_dec_lock(dlg); 
    658659        return; 
    659660    } 
    660661     
     662    /* Invite session has been created, decrement & release dialog lock */ 
     663    pjsip_dlg_dec_lock(dlg); 
    661664 
    662665    /* Attach call data to invite session */ 
     
    845848static pj_status_t init_options(int argc, char *argv[]) 
    846849{ 
    847     static char ip_addr[32]; 
     850    static char ip_addr[PJ_INET_ADDRSTRLEN]; 
    848851    static char local_uri[64]; 
    849852 
     
    886889        const pj_str_t *hostname; 
    887890        pj_sockaddr_in tmp_addr; 
    888         char *addr; 
    889891 
    890892        hostname = pj_gethostname(); 
    891893        pj_sockaddr_in_init(&tmp_addr, hostname, 0); 
    892         addr = pj_inet_ntoa(tmp_addr.sin_addr); 
    893         pj_ansi_strcpy(ip_addr, addr); 
     894        pj_inet_ntop(pj_AF_INET(), &tmp_addr.sin_addr, ip_addr, 
     895                     sizeof(ip_addr)); 
    894896    } 
    895897 
     
    11341136        return; 
    11351137    } 
    1136     tp.__sched_priority = max_prio; 
     1138    tp.sched_priority = max_prio; 
    11371139 
    11381140    rc = sched_setscheduler(0, POLICY, &tp); 
     
    11431145 
    11441146    PJ_LOG(4, (THIS_FILE, "New process policy=%d, priority=%d", 
    1145               policy, tp.__sched_priority)); 
     1147              policy, tp.sched_priority)); 
    11461148 
    11471149    /* 
     
    11561158 
    11571159    PJ_LOG(4, (THIS_FILE, "Old thread policy=%d, priority=%d", 
    1158               policy, tp.__sched_priority)); 
     1160              policy, tp.sched_priority)); 
    11591161 
    11601162    policy = POLICY; 
    1161     tp.__sched_priority = max_prio; 
     1163    tp.sched_priority = max_prio; 
    11621164 
    11631165    rc = pthread_setschedparam(pthread_self(), policy, &tp); 
     
    11691171 
    11701172    PJ_LOG(4, (THIS_FILE, "New thread policy=%d, priority=%d", 
    1171               policy, tp.__sched_priority)); 
     1173              policy, tp.sched_priority)); 
    11721174} 
    11731175 
Note: See TracChangeset for help on using the changeset viewer.