Module: sems Branch: master Commit: cfde500396d29df0b9c9561f2658d646dc6cf5e4 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=cfde500396d29df0b9c9561f2658d646dc6cf5e4
Author: Raphael Coeffic <[email protected]> Committer: Raphael Coeffic <[email protected]> Date: Thu Jan 26 12:30:16 2012 +0100 core: remove references to H_TABLE_ENTRIES where not needed. --- core/hash_table.h | 2 ++ core/sip/trans_table.cpp | 12 ++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/core/hash_table.h b/core/hash_table.h index 3c72679..08ee51b 100644 --- a/core/hash_table.h +++ b/core/hash_table.h @@ -224,7 +224,9 @@ public: void dump() const { for(unsigned long l=0; l<size; l++){ + _table[l]->lock(); _table[l]->dump(); + _table[l]->unlock(); } } diff --git a/core/sip/trans_table.cpp b/core/sip/trans_table.cpp index f1442fd..e3064ef 100644 --- a/core/sip/trans_table.cpp +++ b/core/sip/trans_table.cpp @@ -430,7 +430,7 @@ unsigned int hash(const cstring& ci, const cstring& cs) h = hashlittle(ci.s,ci.len,h); h = hashlittle(cs.s,cs.len,h); - return h & (H_TABLE_ENTRIES-1); + return h; } char _tag_lookup[] = { @@ -514,20 +514,12 @@ trans_bucket* get_trans_bucket(const cstring& callid, const cstring& cseq_num) trans_bucket* get_trans_bucket(unsigned int h) { - assert(h < H_TABLE_ENTRIES); return _trans_table[h]; } void dumps_transactions() { - for(int i=0; i<H_TABLE_ENTRIES; i++){ - - trans_bucket* bucket = get_trans_bucket(i); - - bucket->lock(); - bucket->dump(); - bucket->unlock(); - } + _trans_table.dump(); } _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
