Navigation


Changeset 340:81821e9f6988 in freeDiameter for libfreeDiameter/sessions.c


Ignore:
Timestamp:
Jun 28, 2010, 11:20:48 AM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Fix issue on session cleanup callback parameters -- thanks Souheil for reporting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfreeDiameter/sessions.c

    r293 r340  
    6969        int               eyec; /* An eye catcher also used to ensure the object is valid, must be SH_EYEC */
    7070        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 */
    7272};
    7373
     
    247247
    248248/* Create a new handler */
    249 int fd_sess_handler_create_internal ( struct session_handler ** handler, void (*cleanup)(char * sid, session_state * state) )
     249int fd_sess_handler_create_internal ( struct session_handler ** handler, void (*cleanup)(session_state * state, char * sid) )
    250250{
    251251        struct session_handler *new;
     
    318318                struct state * st = (struct state *)(deleted_states.next->o);
    319319                TRACE_DEBUG(FULL, "Calling cleanup handler for session '%s' and data %p", st->sid, st->state);
    320                 (*del->cleanup)(st->sid, st->state);
     320                (*del->cleanup)(st->state, st->sid);
    321321                free(st->sid);
    322322                fd_list_unlink(&st->chain);
     
    576576                fd_list_unlink(&st->chain);
    577577                TRACE_DEBUG(FULL, "Calling handler %p cleanup for state registered with session '%s'", st->hdl, sess->sid);
    578                 (*st->hdl->cleanup)(sess->sid, st->state);
     578                (*st->hdl->cleanup)(st->state, sess->sid);
    579579                free(st);
    580580        }
Note: See TracChangeset for help on using the changeset viewer.