diff --git a/server/modules/protocol/httpd.c b/server/modules/protocol/httpd.c index b428d72f0..0293f86cb 100644 --- a/server/modules/protocol/httpd.c +++ b/server/modules/protocol/httpd.c @@ -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; } }