Remove unused DCB state
The state was never assigned.
This commit is contained in:
parent
d9fde54b95
commit
d91710c640
@ -60,7 +60,6 @@ typedef enum
|
||||
DCB_STATE_UNDEFINED, /*< State variable with no state */
|
||||
DCB_STATE_ALLOC, /*< Memory allocated but not populated */
|
||||
DCB_STATE_POLLING, /*< Waiting in the poll loop */
|
||||
DCB_STATE_WAITING, /*< Client wanting a connection */
|
||||
DCB_STATE_LISTENING, /*< The DCB is for a listening socket */
|
||||
DCB_STATE_DISCONNECTED, /*< The socket is now closed */
|
||||
DCB_STATE_NOPOLLING, /*< Removed from poll mask */
|
||||
|
@ -3083,7 +3083,7 @@ static uint32_t dcb_process_poll_events(DCB *dcb, uint32_t events)
|
||||
}
|
||||
if ((events & EPOLLIN) && (dcb->n_close == 0))
|
||||
{
|
||||
if (dcb->state == DCB_STATE_LISTENING || dcb->state == DCB_STATE_WAITING)
|
||||
if (dcb->state == DCB_STATE_LISTENING)
|
||||
{
|
||||
MXS_DEBUG("%lu [poll_waitevents] "
|
||||
"Accept in fd %d",
|
||||
|
@ -1392,17 +1392,10 @@ int gw_MySQLAccept(DCB *listener)
|
||||
|
||||
CHK_DCB(listener);
|
||||
|
||||
if (DCB_STATE_WAITING == listener->state)
|
||||
while ((client_dcb = dcb_accept(listener)) != NULL)
|
||||
{
|
||||
gw_process_one_new_client(listener);
|
||||
}
|
||||
else
|
||||
{
|
||||
while ((client_dcb = dcb_accept(listener)) != NULL)
|
||||
{
|
||||
gw_process_one_new_client(client_dcb);
|
||||
} /**< while client_dcb != NULL */
|
||||
}
|
||||
gw_process_one_new_client(client_dcb);
|
||||
} /**< while client_dcb != NULL */
|
||||
|
||||
/* Must have broken out of while loop or received NULL client_dcb */
|
||||
return 1;
|
||||
@ -1424,14 +1417,8 @@ static void gw_process_one_new_client(DCB *client_dcb)
|
||||
}
|
||||
CHK_PROTOCOL(protocol);
|
||||
client_dcb->protocol = protocol;
|
||||
if (DCB_STATE_WAITING == client_dcb->state)
|
||||
{
|
||||
client_dcb->state = DCB_STATE_ALLOC;
|
||||
}
|
||||
else
|
||||
{
|
||||
atomic_add(&client_dcb->service->client_count, 1);
|
||||
}
|
||||
|
||||
atomic_add(&client_dcb->service->client_count, 1);
|
||||
//send handshake to the client_dcb
|
||||
MySQLSendHandshake(client_dcb);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user