MXS-2013 Remove skygw_chk_t

This commit is contained in:
Johan Wikman
2018-08-14 14:57:06 +03:00
parent bdb7481357
commit 8fd1648217
20 changed files with 0 additions and 231 deletions

View File

@ -62,14 +62,8 @@ enum user_type
*/
typedef struct admin_session
{
#if defined(SS_DEBUG)
skygw_chk_t adminses_chk_top;
#endif
char user[ADMIN_USER_MAXLEN + 1]; /*< username */
bool validated; /* Was user validated? */
#if defined(SS_DEBUG)
skygw_chk_t adminses_chk_tail;
#endif
} ADMIN_session;
void admin_users_init();

View File

@ -132,7 +132,6 @@ typedef enum
typedef struct dcb
{
MXS_POLL_DATA poll;
skygw_chk_t dcb_chk_top;
bool dcb_errhandle_called; /*< this can be called only once */
dcb_role_t dcb_role;
int fd; /**< The descriptor */
@ -185,7 +184,6 @@ typedef struct dcb
} thread;
uint32_t n_close; /** How many times dcb_close has been called. */
char *path; /** If a Unix socket, the path it was bound to. */
skygw_chk_t dcb_chk_tail;
} DCB;
/**

View File

@ -51,43 +51,6 @@ MXS_BEGIN_DECLS
#define CHK_NUM_BASE 101
typedef enum skygw_chk_t
{
CHK_NUM_SLIST = CHK_NUM_BASE,
CHK_NUM_SLIST_NODE,
CHK_NUM_SLIST_CURSOR,
CHK_NUM_MLIST,
CHK_NUM_MLIST_NODE,
CHK_NUM_MLIST_CURSOR,
CHK_NUM_QUERY_TEST,
CHK_NUM_LOGFILE,
CHK_NUM_FILEWRITER,
CHK_NUM_THREAD,
CHK_NUM_SIMPLE_MUTEX,
CHK_NUM_MESSAGE,
CHK_NUM_RWLOCK,
CHK_NUM_FNAMES,
CHK_NUM_LOGMANAGER,
CHK_NUM_FILE,
CHK_NUM_BLOCKBUF,
CHK_NUM_HASHTABLE,
CHK_NUM_DCB,
CHK_NUM_PROTOCOL,
CHK_NUM_SESSION,
CHK_NUM_SERVER,
CHK_NUM_ROUTER_SES,
CHK_NUM_MY_SESCMD,
CHK_NUM_ROUTER_PROPERTY,
CHK_NUM_SESCMD_CUR,
CHK_NUM_BACKEND,
CHK_NUM_BACKEND_REF,
CHK_NUM_PREP_STMT,
CHK_NUM_PINFO,
CHK_NUM_MYSQLSES,
CHK_NUM_ADMINSES,
CHK_NUM_MANAGED_LIST
} skygw_chk_t;
# define STRBOOL(b) ((b) ? "true" : "false")
# define STRQTYPE(t) ((t) == QUERY_TYPE_WRITE ? "QUERY_TYPE_WRITE" : \
@ -234,9 +197,6 @@ typedef enum skygw_chk_t
"Unknown DCB reason")))))))
#define CHK_MLIST(l) { \
ss_info_dassert((l->mlist_chk_top == CHK_NUM_MLIST && \
l->mlist_chk_tail == CHK_NUM_MLIST), \
"Single-linked list structure under- or overflow"); \
if (l->mlist_first == NULL) { \
ss_info_dassert(l->mlist_nodecount == 0, \
"List head is NULL but element counter is not zero."); \
@ -260,15 +220,9 @@ typedef enum skygw_chk_t
#define CHK_MLIST_NODE(n) { \
ss_info_dassert((n->mlnode_chk_top == CHK_NUM_MLIST_NODE && \
n->mlnode_chk_tail == CHK_NUM_MLIST_NODE), \
"Single-linked list node under- or overflow"); \
}
#define CHK_MLIST_CURSOR(c) { \
ss_info_dassert(c->mlcursor_chk_top == CHK_NUM_MLIST_CURSOR && \
c->mlcursor_chk_tail == CHK_NUM_MLIST_CURSOR, \
"List cursor under- or overflow"); \
ss_info_dassert(c->mlcursor_list != NULL, \
"List cursor doesn't have list"); \
ss_info_dassert(c->mlcursor_pos != NULL || \
@ -278,9 +232,6 @@ typedef enum skygw_chk_t
}
#define CHK_SLIST(l) { \
ss_info_dassert((l->slist_chk_top == CHK_NUM_SLIST && \
l->slist_chk_tail == CHK_NUM_SLIST), \
"Single-linked list structure under- or overflow"); \
if (l->slist_head == NULL) { \
ss_info_dassert(l->slist_nelems == 0, \
"List head is NULL but element counter is not zero."); \
@ -304,15 +255,9 @@ typedef enum skygw_chk_t
#define CHK_SLIST_NODE(n) { \
ss_info_dassert((n->slnode_chk_top == CHK_NUM_SLIST_NODE && \
n->slnode_chk_tail == CHK_NUM_SLIST_NODE), \
"Single-linked list node under- or overflow"); \
}
#define CHK_SLIST_CURSOR(c) { \
ss_info_dassert(c->slcursor_chk_top == CHK_NUM_SLIST_CURSOR && \
c->slcursor_chk_tail == CHK_NUM_SLIST_CURSOR, \
"List cursor under- or overflow"); \
ss_info_dassert(c->slcursor_list != NULL, \
"List cursor doesn't have list"); \
ss_info_dassert(c->slcursor_pos != NULL || \
@ -322,15 +267,9 @@ typedef enum skygw_chk_t
}
#define CHK_QUERY_TEST(q) { \
ss_info_dassert(q->qt_chk_top == CHK_NUM_QUERY_TEST && \
q->qt_chk_tail == CHK_NUM_QUERY_TEST, \
"Query test under- or overflow."); \
}
#define CHK_LOGFILE(lf) { \
ss_info_dassert(lf->lf_chk_top == CHK_NUM_LOGFILE && \
lf->lf_chk_tail == CHK_NUM_LOGFILE, \
"Logfile struct under- or overflow"); \
ss_info_dassert(lf->lf_filepath != NULL && \
lf->lf_name_prefix != NULL && \
lf->lf_name_suffix != NULL && \
@ -339,27 +278,15 @@ typedef enum skygw_chk_t
}
#define CHK_FILEWRITER(fwr) { \
ss_info_dassert(fwr->fwr_chk_top == CHK_NUM_FILEWRITER && \
fwr->fwr_chk_tail == CHK_NUM_FILEWRITER, \
"File writer struct under- or overflow"); \
}
#define CHK_THREAD(thr) { \
ss_info_dassert(thr->sth_chk_top == CHK_NUM_THREAD && \
thr->sth_chk_tail == CHK_NUM_THREAD, \
"Thread struct under- or overflow"); \
}
#define CHK_SIMPLE_MUTEX(sm) { \
ss_info_dassert(sm->sm_chk_top == CHK_NUM_SIMPLE_MUTEX && \
sm->sm_chk_tail == CHK_NUM_SIMPLE_MUTEX, \
"Simple mutex struct under- or overflow"); \
}
#define CHK_MESSAGE(mes) { \
ss_info_dassert(mes->mes_chk_top == CHK_NUM_MESSAGE && \
mes->mes_chk_tail == CHK_NUM_MESSAGE, \
"Message struct under- or overflow"); \
}
@ -377,63 +304,34 @@ typedef enum skygw_chk_t
}
#define CHK_FNAMES_CONF(fn) { \
ss_info_dassert(fn->fn_chk_top == CHK_NUM_FNAMES && \
fn->fn_chk_tail == CHK_NUM_FNAMES, \
"File names confs struct under- or overflow"); \
}
#define CHK_LOGMANAGER(lm) { \
ss_info_dassert(lm->lm_chk_top == CHK_NUM_LOGMANAGER && \
lm->lm_chk_tail == CHK_NUM_LOGMANAGER, \
"Log manager struct under- or overflow"); \
}
#define CHK_FILE(f) { \
ss_info_dassert(f->sf_chk_top == CHK_NUM_FILE && \
f->sf_chk_tail == CHK_NUM_FILE, \
"File struct under- or overflow"); \
}
#define CHK_BLOCKBUF(bb) { \
ss_info_dassert(bb->bb_chk_top == CHK_NUM_BLOCKBUF, \
"Block buf under- or overflow"); \
}
#define CHK_HASHTABLE(t) { \
ss_info_dassert(t->ht_chk_top == CHK_NUM_HASHTABLE && \
t->ht_chk_tail == CHK_NUM_HASHTABLE, \
"Hashtable under- or overflow"); \
}
#define CHK_MANAGED_LIST(l) { \
ss_info_dassert(l->list_entry_chk_top == CHK_NUM_MANAGED_LIST && \
l->list_entry_chk_tail == CHK_NUM_MANAGED_LIST, \
"Managed list under- or overflow"); \
}
#define CHK_DCB(d) { \
ss_info_dassert(d->dcb_chk_top == CHK_NUM_DCB && \
d->dcb_chk_tail == CHK_NUM_DCB, \
"Dcb under- or overflow"); \
}
#define CHK_PROTOCOL(p) { \
ss_info_dassert(p->protocol_chk_top == CHK_NUM_PROTOCOL && \
p->protocol_chk_tail == CHK_NUM_PROTOCOL, \
"Protocol under- or overflow"); \
}
#define CHK_SESSION(s) { \
ss_info_dassert(s->ses_chk_top == CHK_NUM_SESSION && \
s->ses_chk_tail == CHK_NUM_SESSION, \
"Session under- or overflow"); \
}
#define CHK_SERVER(s) { \
ss_info_dassert(s->server_chk_top == CHK_NUM_SERVER && \
s->server_chk_tail == CHK_NUM_SERVER, \
"Server under- or overflow"); \
}
#define CHK_GWBUF(b) { \
@ -442,63 +340,33 @@ typedef enum skygw_chk_t
}
#define CHK_CLIENT_RSES(r) { \
ss_info_dassert((r)->rses_chk_top == CHK_NUM_ROUTER_SES && \
(r)->rses_chk_tail == CHK_NUM_ROUTER_SES, \
"Router client session has invalid check fields"); \
}
#define CHK_RSES_PROP(p) { \
ss_info_dassert((p)->rses_prop_chk_top == CHK_NUM_ROUTER_PROPERTY && \
(p)->rses_prop_chk_tail == CHK_NUM_ROUTER_PROPERTY, \
"Router property has invalid check fields"); \
}
#define CHK_MYSQL_SESCMD(s) { \
ss_info_dassert((s)->my_sescmd_chk_top == CHK_NUM_MY_SESCMD && \
(s)->my_sescmd_chk_tail == CHK_NUM_MY_SESCMD, \
"Session command has invalid check fields"); \
}
#define CHK_SESCMD_CUR(c) { \
ss_info_dassert((c)->scmd_cur_chk_top == CHK_NUM_SESCMD_CUR && \
(c)->scmd_cur_chk_tail == CHK_NUM_SESCMD_CUR, \
"Session command cursor has invalid check fields"); \
}
#define CHK_BACKEND(b) { \
ss_info_dassert((b)->be_chk_top == CHK_NUM_BACKEND && \
(b)->be_chk_tail == CHK_NUM_BACKEND, \
"BACKEND has invalid check fields"); \
}
#define CHK_BACKEND_REF(r) { \
ss_info_dassert((r)->bref_chk_top == CHK_NUM_BACKEND_REF && \
(r)->bref_chk_tail == CHK_NUM_BACKEND_REF, \
"Backend reference has invalid check fields"); \
}
#define CHK_PREP_STMT(p) { \
ss_info_dassert((p)->pstmt_chk_top == CHK_NUM_PREP_STMT && \
(p)->pstmt_chk_tail == CHK_NUM_PREP_STMT, \
"Prepared statement struct has invalid check fields"); \
}
#define CHK_PARSING_INFO(p) { \
ss_info_dassert((p)->pi_chk_top == CHK_NUM_PINFO && \
(p)->pi_chk_tail == CHK_NUM_PINFO, \
"Parsing info struct has invalid check fields"); \
}
#define CHK_MYSQL_SESSION(s) { \
ss_info_dassert((s)->myses_chk_top == CHK_NUM_MYSQLSES && \
(s)->myses_chk_tail == CHK_NUM_MYSQLSES, \
"MYSQL session struct has invalid check fields"); \
}
#define CHK_ADMIN_SESSION(s) { \
ss_info_dassert((s)->adminses_chk_top == CHK_NUM_ADMINSES && \
(s)->adminses_chk_tail == CHK_NUM_ADMINSES, \
"Admin session struct has invalid check fields"); \
}

View File

@ -71,9 +71,6 @@ typedef void (*HASHFREEFN)(void *);
*/
typedef struct hashtable
{
#if defined(SS_DEBUG)
skygw_chk_t ht_chk_top;
#endif
int hashsize; /**< The number of HASHENTRIES */
HASHENTRIES **entries; /**< The entries themselves */
HASHHASHFN hashfn; /**< The hash function */
@ -87,9 +84,6 @@ typedef struct hashtable
int writelock; /**< The table is locked by a writer */
bool ht_isflat; /**< Indicates whether hashtable is in stack or heap */
int n_elements; /**< Number of added elements */
#if defined(SS_DEBUG)
skygw_chk_t ht_chk_tail;
#endif
} HASHTABLE;
extern HASHTABLE *hashtable_alloc(int, HASHHASHFN hashfn, HASHCMPFN cmpfn);

View File

@ -139,17 +139,11 @@ typedef enum
*/
typedef struct mysql_session
{
#if defined(SS_DEBUG)
skygw_chk_t myses_chk_top;
#endif
uint8_t client_sha1[MYSQL_SCRAMBLE_LEN]; /*< SHA1(password) */
char user[MYSQL_USER_MAXLEN + 1]; /*< username */
char db[MYSQL_DATABASE_MAXLEN + 1]; /*< database */
int auth_token_len; /*< token length */
uint8_t *auth_token; /*< token */
#if defined(SS_DEBUG)
skygw_chk_t myses_chk_tail;
#endif
} MYSQL_session;
/** Protocol packing macros. */
@ -320,9 +314,6 @@ static const char* const MXS_LAST_GTID = "last_gtid";
*/
typedef struct
{
#if defined(SS_DEBUG)
skygw_chk_t protocol_chk_top;
#endif
int fd; /*< The socket descriptor */
struct dcb* owner_dcb; /*< The DCB of the socket we are running on */
mxs_mysql_cmd_t current_command; /*< Current command being executed */
@ -340,9 +331,6 @@ typedef struct
bool changing_user;
uint32_t num_eof_packets; /*< Encountered eof packet number, used for check packet type */
bool large_query; /*< Whether to ignore the command byte of the next packet*/
#if defined(SS_DEBUG)
skygw_chk_t protocol_chk_tail;
#endif
} MySQLProtocol;
typedef struct

View File

@ -114,9 +114,6 @@ static uint64_t server_encode_version(const SERVER_VERSION* server_version)
*/
typedef struct server
{
#if defined(SS_DEBUG)
skygw_chk_t server_chk_top;
#endif
// Base settings
char *name; /**< Server config name */
char address[MAX_SERVER_ADDRESS_LEN]; /**< Server hostname/IP-address */
@ -159,9 +156,6 @@ typedef struct server
* by rwsplit. TODO: Move to rwsplit */
bool warn_ssl_not_enabled; /**< SSL not used for an SSL enabled server */
MxsDiskSpaceThreshold* disk_space_threshold; /**< Disk space thresholds */
#if defined(SS_DEBUG)
skygw_chk_t server_chk_tail;
#endif
} SERVER;
enum

View File

@ -165,7 +165,6 @@ typedef char* (*session_variable_handler_t)(void* context,
*/
typedef struct session
{
skygw_chk_t ses_chk_top;
mxs_session_state_t state; /*< Current descriptor state */
uint64_t ses_id; /*< Unique session identifier */
struct dcb *client_dcb; /*< The client connection */
@ -186,7 +185,6 @@ typedef struct session
GWBUF* buffer; /*< Buffer to deliver to up. */
} response; /*< Shortcircuited response */
session_close_t close_reason; /*< Reason why the session was closed */
skygw_chk_t ses_chk_tail;
} MXS_SESSION;
/**