Changeset 2127
- Timestamp:
- Jul 12, 2008 9:10:25 PM (16 years ago)
- Location:
- pjproject/trunk/pjsip/src/pjsip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
r2039 r2127 106 106 static pj_status_t endpt_on_tx_msg( pjsip_endpoint *endpt, 107 107 pjsip_tx_data *tdata ); 108 static pj_status_t unload_module(pjsip_endpoint *endpt, 109 pjsip_module *mod); 108 110 109 111 /* Defined in sip_parser.c */ … … 241 243 } 242 244 245 /* Unload module */ 246 status = unload_module(endpt, mod); 247 248 on_return: 249 pj_rwmutex_unlock_write(endpt->mod_mutex); 250 251 if (status != PJ_SUCCESS) { 252 char errmsg[PJ_ERR_MSG_SIZE]; 253 254 pj_strerror(status, errmsg, sizeof(errmsg)); 255 PJ_LOG(3,(THIS_FILE, "Module \"%.*s\" can not be unregistered: %s", 256 (int)mod->name.slen, mod->name.ptr, errmsg)); 257 } 258 259 return status; 260 } 261 262 static pj_status_t unload_module(pjsip_endpoint *endpt, 263 pjsip_module *mod) 264 { 265 pj_status_t status; 266 243 267 /* Try to unload the module. */ 244 268 if (mod->unload) { 245 269 status = (*mod->unload)(); 246 if (status != PJ_SUCCESS) goto on_return; 270 if (status != PJ_SUCCESS) 271 return status; 247 272 } 248 273 … … 264 289 PJ_LOG(4,(THIS_FILE, "Module \"%.*s\" unregistered", 265 290 (int)mod->name.slen, mod->name.ptr)); 266 267 on_return:268 pj_rwmutex_unlock_write(endpt->mod_mutex);269 270 if (status != PJ_SUCCESS) {271 char errmsg[PJ_ERR_MSG_SIZE];272 273 pj_strerror(status, errmsg, sizeof(errmsg));274 PJ_LOG(3,(THIS_FILE, "Module \"%.*s\" can not be unregistered: %s",275 (int)mod->name.slen, mod->name.ptr, errmsg));276 }277 291 278 292 return status; … … 553 567 PJ_LOG(5, (THIS_FILE, "Destroying endpoing instance..")); 554 568 555 /* Unregister modules.*/569 /* Phase 1: stop all modules */ 556 570 mod = endpt->module_list.prev; 557 571 while (mod != &endpt->module_list) { 558 572 pjsip_module *prev = mod->prev; 559 pjsip_endpt_unregister_module(endpt, mod); 573 if (mod->stop) { 574 (*mod->stop)(); 575 } 576 mod = prev; 577 } 578 579 /* Phase 2: unload modules. */ 580 mod = endpt->module_list.prev; 581 while (mod != &endpt->module_list) { 582 pjsip_module *prev = mod->prev; 583 unload_module(endpt, mod); 560 584 mod = prev; 561 585 } -
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r2039 r2127 678 678 pj_hash_iterator_t *next = pj_hash_next(mod_tsx_layer.htable, it); 679 679 if (tsx) { 680 pjsip_tsx_terminate(tsx, PJSIP_SC_SERVICE_UNAVAILABLE); 680 681 mod_tsx_layer_unregister_tsx(tsx); 681 682 tsx_destroy(tsx);
Note: See TracChangeset
for help on using the changeset viewer.