Changes to try to eliminate setting dcb->session to NULL with risk of crashing system.

This commit is contained in:
counterpoint
2015-08-24 12:12:43 +01:00
parent 5e2e2585ad
commit 37ac158791
7 changed files with 182 additions and 194 deletions

View File

@ -351,7 +351,8 @@ int n_connect = 0;
memcpy(&client->func, &MyObject, sizeof(GWPROTOCOL));
/* we don't need the session */
client->session = NULL;
/* But not clear that we have one! */
/* client->session = NULL; */
/* create the session data for HTTPD */
client_data = (HTTPD_session *)calloc(1, sizeof(HTTPD_session));
@ -360,9 +361,10 @@ int n_connect = 0;
client->session =
session_alloc(dcb->session->service, client);
if (poll_add_dcb(client) == -1)
if (NULL == client->session || poll_add_dcb(client) == -1)
{
close(so);
dcb_close(client);
return n_connect;
}
n_connect++;

View File

@ -291,7 +291,7 @@ int n_connect = 0;
client_dcb->session =
session_alloc(dcb->session->service, client_dcb);
if (poll_add_dcb(client_dcb))
if (NULL == client_dcb->session || poll_add_dcb(client_dcb))
{
dcb_close(dcb);
return n_connect;

View File

@ -311,6 +311,11 @@ int n_connect = 0;
memcpy(&client_dcb->func, &MyObject, sizeof(GWPROTOCOL));
client_dcb->session =
session_alloc(dcb->session->service, client_dcb);
if (NULL == client_dcb->session)
{
dcb_close(client_dcb);
return n_connect;
}
telnetd_pr = (TELNETD *)malloc(sizeof(TELNETD));
client_dcb->protocol = (void *)telnetd_pr;

View File

@ -1684,7 +1684,7 @@ static skygw_query_type_t is_read_tmp_table(
{
skygw_log_write(LE,"[%s] Error: Master server reference is NULL.",
__FUNCTION__);
return;
return type;
}
rses_prop_tmp = router_cli_ses->rses_properties[RSES_PROP_TYPE_TMPTABLES];