Changeset 2822 for pjproject/trunk


Ignore:
Timestamp:
Jun 30, 2009 1:47:44 PM (15 years ago)
Author:
bennylp
Message:

Ticket #911: Crash when receiving NOTIFY after subscription is terminated (thanks Johan Lantz for the report)

  • fixed the bug by not processing the NOTIFY if the subscription is already terminated
  • also added SIPp scenario to reproduce the bug
Location:
pjproject/trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub.c

    r2730 r2822  
    13791379    } 
    13801380 
    1381     if (dlgsub == dlgsub_head) { 
     1381    /* Note:  
     1382     *  the second condition is for http://trac.pjsip.org/repos/ticket/911  
     1383     */ 
     1384    if (dlgsub == dlgsub_head || 
     1385        (dlgsub->sub &&  
     1386            pjsip_evsub_get_state(dlgsub->sub)==PJSIP_EVSUB_STATE_TERMINATED)) 
     1387    { 
     1388        const char *reason_msg =  
     1389            (dlgsub == dlgsub_head ? "Subscription Does Not Exist" : 
     1390             "Subscription already terminated"); 
     1391 
    13821392        /* This could be incoming request to create new subscription */ 
    13831393        PJ_LOG(4,(THIS_FILE,  
    1384                   "Subscription not found for %.*s, event=%.*s;id=%.*s", 
     1394                  "%s for %.*s, event=%.*s;id=%.*s", 
     1395                  reason_msg, 
    13851396                  (int)tsx->method.name.slen, 
    13861397                  tsx->method.name.ptr, 
     
    13941405            pjsip_method_cmp(&tsx->method, &pjsip_notify_method)==0) 
    13951406        { 
    1396             pj_str_t reason = pj_str("Subscription Does Not Exist"); 
     1407            pj_str_t reason; 
    13971408            pjsip_tx_data *tdata; 
    13981409            pj_status_t status; 
    13991410 
     1411            pj_cstr(&reason, reason_msg); 
    14001412            status = pjsip_dlg_create_response(dlg,  
    14011413                                               event->body.tsx_state.src.rdata,  
Note: See TracChangeset for help on using the changeset viewer.