In newSession (readconnroute.c) connect_dcb will create backend connection via backend_dcb->func.connect()

session_alloc will not start a newSession for the LISTENING socket

In dcb.h void *data was added to keep protocol session data if the session is not started in accept(9 but later.
This commit is contained in:
Massimiliano Pinto
2013-06-20 19:06:16 +02:00
parent 088b3473bc
commit 237a311dda
3 changed files with 8 additions and 2 deletions

View File

@ -66,7 +66,9 @@ SESSION *session;
session->state = SESSION_STATE_ALLOC;
client->session = session;
session->router_session = service->router->newSession(service->router_instance, session);
// this will prevent the connect() backends via connect_dcb() for listening socket
if (client->state != DCB_STATE_LISTENING)
session->router_session = service->router->newSession(service->router_instance, session);
spinlock_acquire(&session_spin);
session->next = allSessions;