Changeset 340:81821e9f6988 in freeDiameter
- Timestamp:
- Jun 28, 2010, 11:20:48 AM (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_radgw/rgwx_echodrop.c
r270 r340 39 39 40 40 /* If a session is destroyed, empty the list of ed_saved_attribute */ 41 static void state_delete(void * arg ) {41 static void state_delete(void * arg, char * sid) { 42 42 struct fd_list * list = (struct fd_list *)arg; 43 43 -
freeDiameter/tests/testsess.c
r258 r340 47 47 }; 48 48 49 static void mycleanup( char * sid, struct mystate * data)49 static void mycleanup( struct mystate * data, char * sid ) 50 50 { 51 51 /* sanity */ … … 268 268 CHECK( NULL, tms ); 269 269 270 mycleanup( str1, ms[0]);271 mycleanup( str1, ms[1]);270 mycleanup(ms[0], str1); 271 mycleanup(ms[1], str1); 272 272 273 273 /* Now create 6 states */ … … 350 350 CHECK( 0, fd_sess_state_retrieve( hdl1, sess1, &tms ) ); 351 351 CHECK( 0, fd_sess_getsid(sess1, &str1) ); 352 mycleanup( str1, tms);352 mycleanup(tms, str1); 353 353 } 354 354 -
include/freeDiameter/libfreeDiameter.h
r336 r340 1527 1527 * ENOMEM : Not enough memory to complete the operation 1528 1528 */ 1529 int fd_sess_handler_create_internal ( struct session_handler ** handler, void (*cleanup)( char * sid, session_state * state) );1529 int fd_sess_handler_create_internal ( struct session_handler ** handler, void (*cleanup)(session_state * state, char * sid) ); 1530 1530 /* Macro to avoid casting everywhere */ 1531 1531 #define fd_sess_handler_create( _handler, _cleanup ) \ 1532 fd_sess_handler_create_internal( (_handler), (void (*)(char *, session_state *))(_cleanup) ) 1533 1532 fd_sess_handler_create_internal( (_handler), (void (*)(session_state *, char *))(_cleanup) ) 1533 1534 1534 1535 /* 1535 1536 * FUNCTION: fd_sess_handler_destroy -
libfreeDiameter/sessions.c
r293 r340 69 69 int eyec; /* An eye catcher also used to ensure the object is valid, must be SH_EYEC */ 70 70 int id; /* A unique integer to identify this handler */ 71 void (*cleanup)( char *, session_state*); /* The cleanup function to be called for cleaning a state */71 void (*cleanup)(session_state *, char *); /* The cleanup function to be called for cleaning a state */ 72 72 }; 73 73 … … 247 247 248 248 /* Create a new handler */ 249 int fd_sess_handler_create_internal ( struct session_handler ** handler, void (*cleanup)( char * sid, session_state * state) )249 int fd_sess_handler_create_internal ( struct session_handler ** handler, void (*cleanup)(session_state * state, char * sid) ) 250 250 { 251 251 struct session_handler *new; … … 318 318 struct state * st = (struct state *)(deleted_states.next->o); 319 319 TRACE_DEBUG(FULL, "Calling cleanup handler for session '%s' and data %p", st->sid, st->state); 320 (*del->cleanup)(st->s id, st->state);320 (*del->cleanup)(st->state, st->sid); 321 321 free(st->sid); 322 322 fd_list_unlink(&st->chain); … … 576 576 fd_list_unlink(&st->chain); 577 577 TRACE_DEBUG(FULL, "Calling handler %p cleanup for state registered with session '%s'", st->hdl, sess->sid); 578 (*st->hdl->cleanup)(s ess->sid, st->state);578 (*st->hdl->cleanup)(st->state, sess->sid); 579 579 free(st); 580 580 }
Note: See TracChangeset
for help on using the changeset viewer.