[sr-dev] git:master:53cd7df8: kex: removed unused callbacks

Stefan Mititelu stefan.mititelu at 1and1.ro
Mon Nov 2 16:35:24 CET 2015


Module: kamailio
Branch: master
Commit: 53cd7df83c4065fd7a34cd3ce15b6e215ce39278
URL: https://github.com/kamailio/kamailio/commit/53cd7df83c4065fd7a34cd3ce15b6e215ce39278

Author: Stefan Mititelu <stefan.mititelu at 1and1.ro>
Committer: Stefan Mititelu <stefan.mititelu at 1and1.ro>
Date: 2015-11-02T17:32:21+02:00

kex: removed unused callbacks

Removed the two SREV_MODULE_PKG_STATS and SREV_MODULE_SHM_STATS callbacks
that were never used.

---

Modified: events.c
Modified: events.h
Modified: modules/kex/kex_mod.c
Modified: modules/kex/mod_stats.c

---

Diff:  https://github.com/kamailio/kamailio/commit/53cd7df83c4065fd7a34cd3ce15b6e215ce39278.diff
Patch: https://github.com/kamailio/kamailio/commit/53cd7df83c4065fd7a34cd3ce15b6e215ce39278.patch

---

diff --git a/events.c b/events.c
index 3b0d651..5312e7a 100644
--- a/events.c
+++ b/events.c
@@ -165,15 +165,6 @@ int sr_event_register_cb(int type, sr_event_cb_f f)
 					_sr_events_list.rcv_nosip = f;
 				else return -1;
 			break;
-		case SREV_MODULE_PKG_STATS:
-				if(_sr_events_list.mod_update_pkg_stats==0)
-					_sr_events_list.mod_update_pkg_stats = f;
-				else return -1;
-		case SREV_MODULE_SHM_STATS:
-				if(_sr_events_list.mod_update_shm_stats==0)
-					_sr_events_list.mod_update_shm_stats = f;
-				else return -1;
-			break;
 		default:
 			return -1;
 	}
@@ -293,18 +284,6 @@ int sr_event_exec(int type, void *data)
 					ret = _sr_events_list.rcv_nosip(data);
 					return ret;
 				} else return 1;
-		case SREV_MODULE_PKG_STATS:
-				if(unlikely(_sr_events_list.mod_update_pkg_stats!=0))
-				{
-					ret = _sr_events_list.mod_update_pkg_stats(data);
-					return ret;
-				} else return 1;
-		case SREV_MODULE_SHM_STATS:
-				if(unlikely(_sr_events_list.mod_update_shm_stats!=0))
-				{
-					ret = _sr_events_list.mod_update_shm_stats(data);
-					return ret;
-				} else return 1;
 		default:
 			return -1;
 	}
@@ -340,10 +319,6 @@ int sr_event_enabled(int type)
 				return (_sr_events_list.stun_in!=0)?1:0;
 		case SREV_RCV_NOSIP:
 				return (_sr_events_list.rcv_nosip!=0)?1:0;
-		case SREV_MODULE_PKG_STATS:
-				return (_sr_events_list.mod_update_pkg_stats!=0)?1:0;
-		case SREV_MODULE_SHM_STATS:
-				return (_sr_events_list.mod_update_shm_stats!=0)?1:0;
 	}
 	return 0;
 }
diff --git a/events.h b/events.h
index 4443a79..8218453 100644
--- a/events.h
+++ b/events.h
@@ -34,8 +34,6 @@
 #define SREV_TCP_WS_FRAME_IN		10
 #define SREV_TCP_WS_FRAME_OUT		11
 #define SREV_STUN_IN			12
-#define SREV_MODULE_PKG_STATS   13
-#define SREV_MODULE_SHM_STATS   14
 
 #define SREV_CB_LIST_SIZE	3
 
@@ -54,8 +52,6 @@ typedef struct sr_event_cb {
 	sr_event_cb_f tcp_ws_frame_out;
 	sr_event_cb_f stun_in;
 	sr_event_cb_f rcv_nosip;
-	sr_event_cb_f mod_update_pkg_stats;
-	sr_event_cb_f mod_update_shm_stats;
 } sr_event_cb_t;
 
 void sr_event_cb_init(void);
diff --git a/modules/kex/kex_mod.c b/modules/kex/kex_mod.c
index b355810..821eef1 100644
--- a/modules/kex/kex_mod.c
+++ b/modules/kex/kex_mod.c
@@ -147,8 +147,7 @@ static int mod_init(void)
 	register_pkg_proc_stats();
 	pkg_proc_stats_init_rpc();
 
-	register_mod_stats();
-	mod_stats_init();
+	/* per module memmory debugging RPC command */
 	mod_stats_init_rpc();
 
 	return 0;
@@ -174,7 +173,6 @@ static int child_init(int rank)
 static void destroy(void)
 {
 	pkg_proc_stats_destroy();
-	mod_stats_destroy();
 	return;
 }
 
diff --git a/modules/kex/mod_stats.c b/modules/kex/mod_stats.c
index e324957..81186f9 100644
--- a/modules/kex/mod_stats.c
+++ b/modules/kex/mod_stats.c
@@ -62,35 +62,6 @@ int mod_stats_destroy(void)
 	return 0;
 }
 
-
-/**
- *
- */
-static int mod_update_pkg_mod_stats_list(void *data)
-{
-	return 0;
-}
-
-
-/**
- *
- */
-static int mod_update_shm_mod_stats_list(void *data)
-{
-	return 0;
-}
-
-
-/**
- *
- */
-int register_mod_stats(void)
-{
-	sr_event_register_cb(SREV_MODULE_PKG_STATS, mod_update_pkg_mod_stats_list);
-	sr_event_register_cb(SREV_MODULE_SHM_STATS, mod_update_shm_mod_stats_list);
-	return 0;
-}
-
 /**
  *
  */




More information about the sr-dev mailing list