Changes to try to eliminate setting dcb->session to NULL with risk of crashing system.
This commit is contained in:
@ -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++;
|
||||
|
Reference in New Issue
Block a user