summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2011-03-16 07:34:16 +0000
committerNanang Izzuddin <nanang@teluu.com>2011-03-16 07:34:16 +0000
commit2a9988f3e4c9b8d40ffebaa4427908de29324711 (patch)
tree0fec17a1ff6201f61e16e3bb03821c62080be372 /pjsip
parente8673ffff74a0e9a63ce789e884a98a369bc8cc3 (diff)
Fix #1212:
- Updated pj_register_strerror() to just return PJ_SUCCESS when the same range and handler is being re-registered. - Removed the usage of static flag of error string handler registration in some modules, which prevent the re-registration of the handler, e.g: in restarting pjsua, as such flags never got reseted. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3455 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip-simple/evsub.c6
-rw-r--r--pjsip/src/pjsip/sip_endpoint.c11
2 files changed, 7 insertions, 10 deletions
diff --git a/pjsip/src/pjsip-simple/evsub.c b/pjsip/src/pjsip-simple/evsub.c
index bf26a3db..dc662aa6 100644
--- a/pjsip/src/pjsip-simple/evsub.c
+++ b/pjsip/src/pjsip-simple/evsub.c
@@ -287,8 +287,10 @@ PJ_DEF(pj_status_t) pjsip_evsub_init_module(pjsip_endpoint *endpt)
{ "NOTIFY", 6}
};
- pj_register_strerror(PJSIP_SIMPLE_ERRNO_START, PJ_ERRNO_SPACE_SIZE,
- &pjsipsimple_strerror);
+ status = pj_register_strerror(PJSIP_SIMPLE_ERRNO_START,
+ PJ_ERRNO_SPACE_SIZE,
+ &pjsipsimple_strerror);
+ pj_assert(status == PJ_SUCCESS);
PJ_ASSERT_RETURN(endpt != NULL, PJ_EINVAL);
PJ_ASSERT_RETURN(mod_evsub.mod.id == -1, PJ_EINVALIDOP);
diff --git a/pjsip/src/pjsip/sip_endpoint.c b/pjsip/src/pjsip/sip_endpoint.c
index e0fe4f08..3a632885 100644
--- a/pjsip/src/pjsip/sip_endpoint.c
+++ b/pjsip/src/pjsip/sip_endpoint.c
@@ -117,9 +117,6 @@ void deinit_sip_parser(void);
pj_status_t pjsip_tel_uri_subsys_init(void);
-/* Specifies whether error subsystem has been registered to pjlib. */
-static int error_subsys_initialized;
-
/*
* This is the global handler for memory allocation failure, for pools that
* are created by the endpoint (by default, all pools ARE allocated by
@@ -425,11 +422,9 @@ PJ_DEF(pj_status_t) pjsip_endpt_create(pj_pool_factory *pf,
pj_lock_t *lock = NULL;
- if (!error_subsys_initialized) {
- pj_register_strerror(PJSIP_ERRNO_START, PJ_ERRNO_SPACE_SIZE,
- &pjsip_strerror);
- error_subsys_initialized = 1;
- }
+ status = pj_register_strerror(PJSIP_ERRNO_START, PJ_ERRNO_SPACE_SIZE,
+ &pjsip_strerror);
+ pj_assert(status == PJ_SUCCESS);
PJ_LOG(5, (THIS_FILE, "Creating endpoint instance..."));