- new stats support
authorAndrei Pelinescu-Onciul <andrei@iptel.org>
Tue, 5 Jun 2007 21:25:35 +0000 (21:25 +0000)
committerAndrei Pelinescu-Onciul <andrei@iptel.org>
Tue, 5 Jun 2007 21:25:35 +0000 (21:25 +0000)
modules/tm/t_funcs.h
modules/tm/uac.c

index 25ef1f4..a8b8236 100644 (file)
@@ -110,8 +110,16 @@ int send_pr_buffer( struct retr_buf *rb, void *buf, int len);
 
 #ifdef TM_DEL_UNREF
 
-
 #define UNREF_FREE(_T_cell) \
+       do{\
+               if (atomic_dec_and_test(&(_T_cell)->ref_count)){ \
+                       unlink_timers((_T_cell)); \
+                       free_cell((_T_cell)); \
+               }else \
+                       t_stats_delayed_free(); \
+       }while(0)
+
+#define UNREF_NOSTATS(_T_cell) \
        do{\
                if (atomic_dec_and_test(&(_T_cell)->ref_count)){ \
                        unlink_timers((_T_cell)); \
@@ -119,7 +127,7 @@ int send_pr_buffer( struct retr_buf *rb, void *buf, int len);
                }\
        }while(0)
 
-#define UNREF_UNSAFE(_T_cell) UNREF_FREE(_T_cell)
+#define UNREF_UNSAFE(_T_cell) UNREF_NOSTATS(_T_cell)
 /* all the version are safe when using atomic ops */
 #define UNREF(_T_cell) UNREF_UNSAFE(_T_cell); 
 #define REF(_T_cell) (atomic_inc(&(_T_cell)->ref_count))
index 99b5383..86dd9aa 100644 (file)
@@ -76,6 +76,7 @@
 #include "t_msgbuilder.h"
 #include "callid.h"
 #include "uac.h"
+#include "t_stats.h"
 
 
 #define FROM_TAG_LEN (MD5_LEN + 1 /* - */ + CRC16_LEN) /* length of FROM tags */