Fix duplicate listener checks

Only the protocol, port and address of the listener were used to check if
a listener exists. The check should also use the name of the listener to
be sure that each name is unique.

Expanded tests to check that the creation of duplicate listeners is
detected. Did minor improvements to related test code.
This commit is contained in:
Markus Mäkelä
2017-08-07 15:47:16 +03:00
parent c593a1bf32
commit c2a2688b93
8 changed files with 71 additions and 29 deletions

View File

@ -247,7 +247,7 @@ bool serviceHasBackend(SERVICE *service, SERVER *server);
* @param port Listener port
* @return True if service has the listener
*/
bool serviceHasListener(SERVICE *service, const char *protocol,
bool serviceHasListener(SERVICE* service, const char* name, const char* protocol,
const char* address, unsigned short port);
/**