summaryrefslogtreecommitdiff
path: root/pjnath/src/pjturn-srv/server.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-03-20 16:32:06 +0000
committerBenny Prijono <bennylp@teluu.com>2008-03-20 16:32:06 +0000
commitf5c4ac3cbadd515c83b71618e7ff2b1683c2aca2 (patch)
treef3378bd897fc58e21490005bb0000999eaa0940b /pjnath/src/pjturn-srv/server.c
parent7f5db291ab29a7396137961f69470562f5bce4a7 (diff)
More ticket #485: client and server self tested
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1879 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath/src/pjturn-srv/server.c')
-rw-r--r--pjnath/src/pjturn-srv/server.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/pjnath/src/pjturn-srv/server.c b/pjnath/src/pjturn-srv/server.c
index b22cc53b..66f1c6a7 100644
--- a/pjnath/src/pjturn-srv/server.c
+++ b/pjnath/src/pjturn-srv/server.c
@@ -135,7 +135,7 @@ PJ_DEF(pj_status_t) pj_turn_srv_create(pj_pool_factory *pf,
/* Init ports settings */
srv->ports.min_udp = srv->ports.next_udp = MIN_PORT;
- srv->ports.max_tcp = MAX_PORT;
+ srv->ports.max_udp = MAX_PORT;
srv->ports.min_tcp = srv->ports.next_tcp = MIN_PORT;
srv->ports.max_tcp = MAX_PORT;
@@ -265,6 +265,18 @@ PJ_DEF(pj_status_t) pj_turn_srv_destroy(pj_turn_srv *srv)
}
}
+ /* Destroy all allocations FIRST */
+ if (srv->tables.alloc) {
+ it = pj_hash_first(srv->tables.alloc, &itbuf);
+ while (it != NULL) {
+ pj_turn_allocation *alloc = (pj_turn_allocation*)
+ pj_hash_this(srv->tables.alloc, it);
+ pj_hash_iterator_t *next = pj_hash_next(srv->tables.alloc, it);
+ pj_turn_allocation_destroy(alloc);
+ it = next;
+ }
+ }
+
/* Destroy all listeners and STUN sessions associated with them. */
for (i=0; i<srv->core.lis_cnt; ++i) {
if (srv->core.listener[i]) {
@@ -277,18 +289,6 @@ PJ_DEF(pj_status_t) pj_turn_srv_destroy(pj_turn_srv *srv)
}
}
- /* Destroy all allocations */
- if (srv->tables.alloc) {
- it = pj_hash_first(srv->tables.alloc, &itbuf);
- while (it != NULL) {
- pj_turn_allocation *alloc = (pj_turn_allocation*)
- pj_hash_this(srv->tables.alloc, it);
- pj_turn_allocation_destroy(alloc);
- it = pj_hash_next(srv->tables.alloc, it);
- }
- }
-
-
/* Destroy hash tables (well, sort of) */
if (srv->tables.alloc) {
srv->tables.alloc = NULL;