Changeset 1195:16f2d2f15e5b in freeDiameter for extensions/test_app/test_app.c
- Timestamp:
- Jun 11, 2013, 3:05:33 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/test_app/test_app.c
r1127 r1195 44 44 static struct ta_conf _conf; 45 45 static pthread_t ta_stats_th = (pthread_t)NULL; 46 static struct fd_hook_hdl * hookhdl = NULL; 46 47 47 48 static int ta_conf_init(void) … … 96 97 while (1) { 97 98 /* Display statistics every XX seconds */ 98 sleep(ta_conf->bench_duration *3);99 sleep(ta_conf->bench_duration + 3); 99 100 100 101 /* Now, get the current stats */ … … 136 137 } 137 138 139 static void ta_hook_cb(enum fd_hook_type type, struct msg * msg, struct peer_hdr * peer, void * other, struct fd_hook_permsgdata *pmd, void * regdata) { 140 141 } 142 143 138 144 /* entry point */ 139 145 static int ta_entry(char * conffile) … … 172 178 CHECK_FCT( fd_disp_app_support ( ta_appli, ta_vendor, 1, 0 ) ); 173 179 180 if (ta_conf->mode & MODE_BENCH) { 181 /* Register an empty hook to disable the default handling */ 182 CHECK_FCT( fd_hook_register( (1<<HOOK_LAST) - 1, 183 ta_hook_cb, NULL, NULL, &hookhdl) ); 184 185 } 186 174 187 /* Start the statistics thread */ 175 188 CHECK_POSIX( pthread_create(&ta_stats_th, NULL, ta_stats, NULL) ); … … 185 198 if (ta_conf->mode & MODE_SERV) 186 199 ta_serv_fini(); 200 if (hookhdl) 201 fd_hook_unregister( hookhdl ); 187 202 CHECK_FCT_DO( fd_thr_term(&ta_stats_th), ); 188 203 CHECK_POSIX_DO( pthread_mutex_destroy(&ta_conf->stats_lock), );
Note: See TracChangeset
for help on using the changeset viewer.