Changeset 891


Ignore:
Timestamp:
Jan 21, 2007 4:11:18 PM (14 years ago)
Author:
bennylp
Message:

Fixed ticket #73: regc does not respond to 401/407 challenge after it has been marked for deletion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c

    r879 r891  
    574574    regc->has_tsx = PJ_FALSE; 
    575575 
    576     /* If registration data has been deleted by user then remove registration  
    577      * data from transaction's callback, and don't call callback. 
    578      */ 
    579     if (regc->_delete_flag) { 
    580  
    581         /* Nothing to do */ 
    582         ; 
    583  
    584     } else if (tsx->status_code == PJSIP_SC_PROXY_AUTHENTICATION_REQUIRED || 
    585                tsx->status_code == PJSIP_SC_UNAUTHORIZED) 
     576    /* Handle 401/407 challenge (even when _delete_flag is set) */ 
     577    if (tsx->status_code == PJSIP_SC_PROXY_AUTHENTICATION_REQUIRED || 
     578        tsx->status_code == PJSIP_SC_UNAUTHORIZED) 
    586579    { 
    587580        pjsip_rx_data *rdata = event->body.tsx_state.src.rdata; 
     
    598591         
    599592        if (status != PJ_SUCCESS) { 
    600             call_callback(regc, status, tsx->status_code,  
    601                           &rdata->msg_info.msg->line.status.reason, 
    602                           rdata, -1, 0, NULL); 
     593 
     594            /* Only call callback if application is still interested 
     595             * in it. 
     596             */ 
     597            if (regc->_delete_flag == 0) { 
     598                /* Increment busy flag temporarily to prevent regc from 
     599                 * being destroyed. 
     600                 */ 
     601                ++regc->busy; 
     602 
     603                call_callback(regc, status, tsx->status_code,  
     604                              &rdata->msg_info.msg->line.status.reason, 
     605                              rdata, -1, 0, NULL); 
     606 
     607                /* Decrement busy flag */ 
     608                --regc->busy; 
     609            } 
    603610        } 
    604611 
    605         return; 
     612    } else if (regc->_delete_flag) { 
     613 
     614        /* User has called pjsip_regc_destroy(), so don't call callback.  
     615         * This regc will be destroyed later in this function. 
     616         */ 
     617 
     618        /* Nothing to do */ 
     619        ; 
    606620 
    607621    } else { 
Note: See TracChangeset for help on using the changeset viewer.