MXS-1717 Show which listener users are coming from

Earlier, if a service had multiple listeners you would have had

   MaxScale> show dbusers MyService
   User names: alice@% ...
   User names: bob@% ...

That is, no indication of which listener is reporting what. With
this commit the result will be

   User names (MyListener1): alice@% ...
   User names (MyListener2): bob@% ...

Further, the diagnostics function of an authenticator is now expected
to write the list of users to the provided DCB, without performing any
other formatting. The formatting (printing "User names" and appending
a line-feed) is now handled by the handler for the MaxAdmin command
"show dbusers".
This commit is contained in:
Johan Wikman
2018-03-13 09:41:16 +02:00
parent 78123a0333
commit 633b08ed0d
3 changed files with 7 additions and 17 deletions

View File

@ -2485,7 +2485,11 @@ void service_print_users(DCB *dcb, const SERVICE *service)
if (listener_is_active(listener) && listener->listener &&
listener->listener->authfunc.diagnostic)
{
dcb_printf(dcb, "User names (%s): ", listener->name);
listener->listener->authfunc.diagnostic(dcb, listener);
dcb_printf(dcb, "\n");
}
}
}