MXS-2196: Replace listener iterator

The iteration of listeners is now done via the global list of
listeners. This removes the need to have a service before a listener is
accessed which also reflects how the actual configuration is laid out. It
also guarantees that any results returned by the find functions will be
valid as long as the results are used.
This commit is contained in:
Markus Mäkelä
2018-11-29 13:52:43 +02:00
parent 6f9b9f5e95
commit 5247c152c2
4 changed files with 98 additions and 199 deletions

View File

@ -266,10 +266,8 @@ LocalClient* LocalClient::create(MYSQL_session* session, MySQLProtocol* proto, c
LocalClient* LocalClient::create(MYSQL_session* session, MySQLProtocol* proto, SERVICE* service)
{
LocalClient* rval = NULL;
LISTENER_ITERATOR iter;
for (SERV_LISTENER* listener = listener_iterator_init(service, &iter);
listener; listener = listener_iterator_next(&iter))
for (const auto& listener : listener_find_by_service(service))
{
if (listener->port > 0)
{