dcb->data is allocated before poll_add_dcb in httpd_accept()

This will prevent dcb->data to be NULL with threads
This commit is contained in:
Massimiliano Pinto 2013-08-20 11:37:57 +02:00
parent 21dabda848
commit 73ffa5a648

View File

@ -330,16 +330,16 @@ int n_connect = 0;
client->state = DCB_STATE_IDLE;
/* create the session data for HTTPD */
client_data = (HTTPD_session *)calloc(1, sizeof(HTTPD_session));
client->data = client_data;
if (poll_add_dcb(client) == -1)
{
return n_connect;
}
n_connect++;
/* create the session data for HTTPD */
client_data = (HTTPD_session *)calloc(1, sizeof(HTTPD_session));
client->data = client_data;
client->state = DCB_STATE_POLLING;
}
}