Added new state to SESSION: SESSION_STATE_STOPPING, which is set in protocol module before calling closeSession (router). THe new state tells that session is closing and DCBs included may not be polling anymore.

Fixed some crash scenarios.
This commit is contained in:
VilhoRaatikka
2014-05-08 23:17:35 +03:00
parent a1361d9c9e
commit 8be4aba223
8 changed files with 216 additions and 113 deletions

View File

@ -53,6 +53,7 @@ typedef enum {
SESSION_STATE_ALLOC, /*< for all sessions */
SESSION_STATE_READY, /*< for router session */
SESSION_STATE_ROUTER_READY, /*< for router session */
SESSION_STATE_STOPPING, /*< router is being closed */
SESSION_STATE_LISTENER, /*< for listener session */
SESSION_STATE_LISTENER_STOPPED, /*< for listener session */
SESSION_STATE_FREE /*< for all sessions */
@ -93,4 +94,5 @@ void dprintAllSessions(struct dcb *);
void dprintSession(struct dcb *, SESSION *);
char *session_state(int);
bool session_link_dcb(SESSION *, struct dcb *);
#endif
SESSION* get_session_by_router_ses(void* rses);
#endif