summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2015-03-26 02:51:19 +0000
committerNanang Izzuddin <nanang@teluu.com>2015-03-26 02:51:19 +0000
commit7ec442cba4e192d02cf5782899b8c679a3a46e88 (patch)
tree296a6a2b35e50b18bbd3e41aaa162201f5830188
parent3d094f4505abdd25bcf1e34a02b3c6e97c56749c (diff)
Re #1828:
- Fixed failing regc test in pjsip-test due to modification in #1819. - Fixed assertion in destruction of SIP transport loop. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5024 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsip/sip_transport_loop.c4
-rw-r--r--pjsip/src/test/regc_test.c42
2 files changed, 24 insertions, 22 deletions
diff --git a/pjsip/src/pjsip/sip_transport_loop.c b/pjsip/src/pjsip/sip_transport_loop.c
index a612eece..04475154 100644
--- a/pjsip/src/pjsip/sip_transport_loop.c
+++ b/pjsip/src/pjsip/sip_transport_loop.c
@@ -222,7 +222,9 @@ static pj_status_t loop_destroy(pjsip_transport *tp)
loop->thread_quit_flag = 1;
/* Unlock transport mutex before joining thread. */
- pj_lock_release(tp->lock);
+ /// This raised assertion failed "mutex->owner == pj_thread_this()",
+ /// where mutex->owner==NULL
+ //pj_lock_release(tp->lock);
pj_thread_join(loop->thread);
pj_thread_destroy(loop->thread);
diff --git a/pjsip/src/test/regc_test.c b/pjsip/src/test/regc_test.c
index 18abfed1..d503a789 100644
--- a/pjsip/src/test/regc_test.c
+++ b/pjsip/src/test/regc_test.c
@@ -370,14 +370,14 @@ static int do_test(const char *title,
client_cfg->have_reg, client_result.have_reg));
return -260;
}
- if (client_result.interval != client_result.expiration) {
+ if (client_result.have_reg && client_result.interval != client_result.expiration) {
PJ_LOG(3,(THIS_FILE, " error: interval (%d) is different than expiration (%d)",
client_result.interval, client_result.expiration));
return -270;
}
- if (client_result.expiration > 0 && client_result.next_reg < 1) {
- PJ_LOG(3,(THIS_FILE, " error: next_reg=%d, expecting positive number because expiration is %d",
- client_result.next_reg, client_result.expiration));
+ if (client_result.interval > 0 && client_result.next_reg < 1) {
+ PJ_LOG(3,(THIS_FILE, " error: next_reg=%d, expecting positive number because interval is %d",
+ client_result.next_reg, client_result.interval));
return -280;
}
@@ -402,7 +402,7 @@ static int keep_alive_test(const pj_str_t *registrar_uri)
{ PJ_TRUE, 200, PJ_FALSE, EXACT, TIMEOUT, 0, {NULL, 0}};
struct client client_cfg =
/* error code have_reg expiration contact_cnt auth? destroy*/
- { PJ_FALSE, 200, PJ_TRUE, TIMEOUT, 1, PJ_FALSE,PJ_FALSE};
+ { PJ_FALSE, 200, PJ_TRUE, TIMEOUT, 1, PJ_FALSE,PJ_FALSE};
pj_str_t contact = pj_str("<sip:c@C>");
@@ -479,7 +479,7 @@ static int refresh_error(const pj_str_t *registrar_uri,
{ PJ_TRUE, 200, PJ_FALSE, EXACT, TIMEOUT, 0, {NULL, 0}};
struct client client_cfg =
/* error code have_reg expiration contact_cnt auth? destroy*/
- { PJ_FALSE, 200, PJ_TRUE, TIMEOUT, 1, PJ_FALSE,PJ_FALSE};
+ { PJ_FALSE, 200, PJ_TRUE, TIMEOUT, 1, PJ_FALSE,PJ_FALSE};
pj_str_t contact = pj_str("<sip:c@C>");
pjsip_regc *regc;
@@ -536,7 +536,7 @@ static int update_test(const pj_str_t *registrar_uri)
{ PJ_TRUE, 200, PJ_FALSE, EXACT, TIMEOUT, 0, {NULL, 0}};
struct client client_cfg =
/* error code have_reg expiration contact_cnt auth? destroy*/
- { PJ_FALSE, 200, PJ_TRUE, TIMEOUT, 1, PJ_FALSE,PJ_FALSE};
+ { PJ_FALSE, 200, PJ_TRUE, TIMEOUT, 1, PJ_FALSE,PJ_FALSE};
pj_str_t contacts[] = {
{ "<sip:a>", 7 },
{ "<sip:b>", 7 },
@@ -709,10 +709,10 @@ static int auth_send_error(const pj_str_t *registrar_uri,
enum { TIMEOUT = 40 };
struct registrar_cfg server_cfg =
/* respond code auth contact exp_prm expires more_contacts */
- { PJ_TRUE, 200, PJ_TRUE, EXACT, 75, 0, {NULL, 0}};
+ { PJ_TRUE, 200, PJ_TRUE, EXACT, 75, 0, {NULL, 0}};
struct client client_cfg =
/* error code have_reg expiration contact_cnt auth? destroy*/
- { PJ_TRUE, 401, PJ_FALSE, -1, 0, PJ_TRUE, PJ_TRUE};
+ { PJ_TRUE, 401, PJ_FALSE, TIMEOUT, 0, PJ_TRUE, PJ_TRUE};
pj_str_t contact = pj_str("<sip:c@C>");
pjsip_regc *regc;
@@ -774,7 +774,7 @@ int regc_test(void)
/* client expected results: */
/* error code have_reg expiration contact_cnt auth?*/
- { PJ_FALSE, 502, PJ_FALSE, -1, 0, PJ_FALSE}
+ { PJ_FALSE, 502, PJ_FALSE, 600, 0, PJ_FALSE}
},
/* timeout test */
@@ -793,7 +793,7 @@ int regc_test(void)
/* client expected results: */
/* error code have_reg expiration contact_cnt auth? */
- { PJ_FALSE, 408, PJ_FALSE, -1, 0, PJ_FALSE}
+ { PJ_FALSE, 408, PJ_FALSE, 600, 0, PJ_FALSE}
},
/* Basic successful registration scenario:
@@ -816,7 +816,7 @@ int regc_test(void)
/* client expected results: */
/* error code have_reg expiration contact_cnt auth?*/
- { PJ_FALSE, 200, PJ_TRUE, 75, 1, PJ_FALSE}
+ { PJ_FALSE, 200, PJ_TRUE, 75, 1, PJ_FALSE}
},
/* Basic successful registration scenario with authentication
@@ -836,7 +836,7 @@ int regc_test(void)
/* client expected results: */
/* error code have_reg expiration contact_cnt auth?*/
- { PJ_FALSE, 200, PJ_TRUE, 75, 1, PJ_TRUE}
+ { PJ_FALSE, 200, PJ_TRUE, 75, 1, PJ_TRUE}
},
/* a good registrar returns the Contact header as is and
@@ -854,11 +854,11 @@ int regc_test(void)
/* registrar config: */
/* respond code auth contact exp_prm expires more_contacts */
- { PJ_TRUE, 200, PJ_FALSE, EXACT, 75, 65, {"<sip:a@a>;expires=70", 0}},
+ { PJ_TRUE, 200, PJ_FALSE, EXACT, 75, 65, {"<sip:a@a>;expires=70", 0}},
/* client expected results: */
/* error code have_reg expiration contact_cnt auth?*/
- { PJ_FALSE, 200, PJ_TRUE, 75, 2, PJ_FALSE}
+ { PJ_FALSE, 200, PJ_TRUE, 75, 2, PJ_FALSE}
},
@@ -883,7 +883,7 @@ int regc_test(void)
/* client expected results: */
/* error code have_reg expiration contact_cnt auth?*/
- { PJ_FALSE, 200, PJ_TRUE, 75, 1, PJ_FALSE}
+ { PJ_FALSE, 200, PJ_TRUE, 75, 1, PJ_FALSE}
},
@@ -909,7 +909,7 @@ int regc_test(void)
/* client expected results: */
/* error code have_reg expiration contact_cnt auth?*/
- { PJ_FALSE, 200, PJ_TRUE, 75, 2, PJ_FALSE}
+ { PJ_FALSE, 200, PJ_TRUE, 75, 2, PJ_FALSE}
},
@@ -933,7 +933,7 @@ int regc_test(void)
/* client expected results: */
/* error code have_reg expiration contact_cnt auth?*/
- { PJ_FALSE, 202, PJ_TRUE, 75, 1, PJ_FALSE}
+ { PJ_FALSE, 202, PJ_TRUE, 75, 1, PJ_FALSE}
},
@@ -957,7 +957,7 @@ int regc_test(void)
/* client expected results: */
/* error code have_reg expiration contact_cnt auth?*/
- { PJ_FALSE, 200, PJ_TRUE, 65, 2, PJ_FALSE}
+ { PJ_FALSE, 200, PJ_TRUE, 65, 2, PJ_FALSE}
},
/* the registrar doesn't return any bindings, but for some
@@ -979,7 +979,7 @@ int regc_test(void)
/* client expected results: */
/* error code have_reg expiration contact_cnt auth?*/
- { PJ_FALSE, 200, PJ_TRUE, 65, 0, PJ_FALSE}
+ { PJ_FALSE, 200, PJ_TRUE, 65, 0, PJ_FALSE}
},
/* Neither Contact header nor Expires header are present.
@@ -1000,7 +1000,7 @@ int regc_test(void)
/* client expected results: */
/* error code have_reg expiration contact_cnt auth?*/
- { PJ_FALSE, 200, PJ_TRUE, 600, 0, PJ_FALSE}
+ { PJ_FALSE, 200, PJ_TRUE, 600, 0, PJ_FALSE}
},
};