Allocate DCB on owning thread

The DCB is now fully allocated on the thread that owns it. This guarantees
that the owner is always correct when it is used.

The code in poll_add_dcb still manipulates which worker the DCB is
allocated. This needs to be removed and the detection of special needs
(maxadmin, maxinfo) must be moved into the listener.
This commit is contained in:
Markus Mäkelä
2019-04-26 10:16:03 +03:00
parent dc244342f8
commit 510cae2fe0
2 changed files with 103 additions and 84 deletions

View File

@ -271,9 +271,18 @@ private:
/**
* Accept a single client connection
*
* @param fd The opened file descriptor to which the client is connected to
* @param addr The network information
* @param host The host where the client is connecting from
*
* @return The new DCB or nullptr on error
*/
DCB* accept_one_dcb();
DCB* accept_one_dcb(int fd, const sockaddr_storage* addr, const char* host);
/**
* Accept all available client connections
*/
void accept_connections();
/**
* The file descriptor for accepting new connections