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:
parent
21dabda848
commit
73ffa5a648
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user