KILL [CONNECTION | QUERY] support, part2B

Various small changes to part2, as suggested by comments and otherwise.
Mostly renaming, working logic should not change.

Exception: session id changed to 64bit in the container and associated
functions. Another commit will change it to 64bit in the session itself.
This commit is contained in:
Esa Korhonen
2017-05-04 17:51:10 +03:00
parent 17f6e94cba
commit ee20191645
6 changed files with 84 additions and 68 deletions

View File

@ -117,25 +117,29 @@ bool mxs_worker_post_message(MXS_WORKER* worker, uint32_t msg_id, intptr_t arg1,
size_t mxs_worker_broadcast_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2);
/**
* Add a session to the current worker's session map.
* @param id With which id to add. Typically session->ses_id.
* Add a session to the current worker's session container. Currently only
* required for some special commands e.g. "KILL <process_id>" to work.
*
* @param session Session to add.
* @return true if successful, false if id already existed in map.
*/
bool mxs_add_to_session_map(uint32_t id, MXS_SESSION* session);
bool mxs_worker_register_session(MXS_SESSION* session);
/**
* Remove a session from the current worker's session map.
* Remove a session from the current worker's session container. Does not actually
* remove anything from an epoll-set or affect the session in any way.
*
* @param id Which id to remove.
* @return The removed session or NULL if not found.
*/
MXS_SESSION* mxs_remove_from_session_map(uint32_t id);
MXS_SESSION* mxs_worker_deregister_session(uint64_t id);
/**
* Find a session in the current worker's session map.
* Find a session in the current worker's session container.
*
* @param id Which id to find.
* @return The found session or NULL if not found.
*/
MXS_SESSION* mxs_find_in_session_map(uint32_t id);
MXS_SESSION* mxs_worker_find_session(uint64_t id);
MXS_END_DECLS