poll.c:Returned checks for zombie

mysql_backend.c:don't write to session->client if session->client is NULL
mysql_common.c:assert if called with dcb==NULL
This commit is contained in:
vraatikka
2013-09-12 22:34:49 +03:00
parent bbc9dcc9a3
commit d7e793a411
3 changed files with 31 additions and 3 deletions

View File

@ -39,13 +39,33 @@ extern int gw_MySQLWrite_backend(DCB *dcb, GWBUF *queue);
extern int gw_error_backend_event(DCB *dcb);
/**
* @node Creates MySQL protocol structure
*
* Parameters:
* @param dcb - in, use
* Must be non-NULL.
*
* @return
*
*
* @details (write detailed description here)
*
*/
MySQLProtocol* mysql_protocol_init(
DCB* dcb)
{
MySQLProtocol* p;
if (dcb != NULL) {
CHK_DCB(dcb);
CHK_DCB(dcb);
if (dcb == NULL) {
skygw_log_write_flush(
LOGFILE_ERROR,
"%lu [mysql_init_protocol] MySQL protocol init failed : "
"called with DCB == NULL.",
pthread_self());
return NULL;
}
p = (MySQLProtocol *) calloc(1, sizeof(MySQLProtocol));
ss_dassert(p != NULL);