Changeset 6:b0d377c79d80 in freeDiameter for libfreeDiameter/sessions.c
- Timestamp:
- Sep 3, 2009, 4:03:25 PM (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfreeDiameter/sessions.c
r5 r6 242 242 243 243 /* Create a new handler */ 244 int fd_sess_handler_create_int ( struct session_handler ** handler, void (*cleanup)(char * sid, session_state * state) )244 int fd_sess_handler_create_internal ( struct session_handler ** handler, void (*cleanup)(char * sid, session_state * state) ) 245 245 { 246 246 struct session_handler *new; … … 565 565 } 566 566 567 /* Destroy a session if it is not used */ 568 int fd_sess_reclaim ( struct session ** session ) 569 { 570 struct session * sess; 571 572 TRACE_ENTRY("%p", session); 573 CHECK_PARAMS( session && VALIDATE_SI(*session) ); 574 575 sess = *session; 576 *session = NULL; 577 578 CHECK_FCT( pthread_mutex_lock( H_LOCK(sess->hash) ) ); 579 CHECK_FCT( pthread_mutex_lock( &exp_lock ) ); 580 if (FD_IS_LIST_EMPTY(&sess->states)) { 581 fd_list_unlink( &sess->chain_h ); 582 fd_list_unlink( &sess->expire ); 583 sess->eyec = 0xdead; 584 free(sess->sid); 585 free(sess); 586 } 587 CHECK_FCT( pthread_mutex_unlock( &exp_lock ) ); 588 CHECK_FCT( pthread_mutex_unlock( H_LOCK(sess->hash) ) ); 589 590 return 0; 591 } 592 567 593 568 594 569 595 /* Save a state information with a session */ 570 int fd_sess_state_store_int ( struct session_handler * handler, struct session * session, session_state ** state )596 int fd_sess_state_store_internal ( struct session_handler * handler, struct session * session, session_state ** state ) 571 597 { 572 598 struct state *new; … … 617 643 618 644 /* Get the data back */ 619 int fd_sess_state_retrieve_int ( struct session_handler * handler, struct session * session, session_state ** state )645 int fd_sess_state_retrieve_internal ( struct session_handler * handler, struct session * session, session_state ** state ) 620 646 { 621 647 struct fd_list * li;
Note: See TracChangeset
for help on using the changeset viewer.