Module: sems
Branch: master
Commit: f1a1aa937ef94fa361ac55b32bfe0b168aff6c0f
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=f1a1aa937ef94fa361ac55b32bfe0b168aff6c0f

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Thu Feb  2 18:19:56 2012 +0100

core: enables dumping the transaction table on exit.

---

 core/hash_table.h        |    2 +-
 core/sip/trans_table.cpp |   16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/core/hash_table.h b/core/hash_table.h
index 08ee51b..ec98c37 100644
--- a/core/hash_table.h
+++ b/core/hash_table.h
@@ -179,7 +179,7 @@ public:
        
        for(typename value_map::const_iterator it = elmts.begin(); it != 
elmts.end(); ++it) {
            
-           (*it)->dump();
+           it->second->dump();
        }
     }
 
diff --git a/core/sip/trans_table.cpp b/core/sip/trans_table.cpp
index e3064ef..28630a6 100644
--- a/core/sip/trans_table.cpp
+++ b/core/sip/trans_table.cpp
@@ -46,7 +46,21 @@
 // Global transaction table
 //
 
-hash_table<trans_bucket> _trans_table(H_TABLE_ENTRIES);
+class trans_table
+    : public hash_table<trans_bucket>
+{
+public:
+    trans_table(unsigned long size)
+       : hash_table<trans_bucket>(size) 
+    {}
+
+    ~trans_table()
+    {
+       dump();
+    }
+};
+
+trans_table _trans_table(H_TABLE_ENTRIES);
 
 trans_bucket::trans_bucket(unsigned long id)
     : ht_bucket<sip_trans>::ht_bucket(id)

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to