MXS-2196: Allocate a session before allocating DCBs
Allocating the session before a DCB guarantees that at no point will a DCB have a null session. This further clarifies the concept of the session and also allows the listener reference to be moved there. Ideally, the session itself would allocate and assign the client DCB but since the Listener is the only one who does it, it's acceptable for now.
This commit is contained in:
@ -204,7 +204,7 @@ static int httpd_read_event(DCB* dcb)
|
||||
/** If listener->authenticator is the default authenticator, it means that
|
||||
* we don't need to check the user credentials. All other authenticators
|
||||
* cause a 401 Unauthorized to be returned on the first try. */
|
||||
bool auth_ok = httpd_default_auth() == std::string(dcb->listener->authenticator());
|
||||
bool auth_ok = httpd_default_auth() == std::string(dcb->session->listener->authenticator());
|
||||
|
||||
/**
|
||||
* Get the request headers
|
||||
|
Reference in New Issue
Block a user