Take Backend into use in rwsplit_select_backends.cc
This is the first step to taking the Backend class into use. It is now used in rwsplit_select_backends.cc and readwritesplit.hh. The module is not yet functional and doesn't even compile. Added some helper functions to the Backend class to get easier access to the server referenced by the SERVER_REF and to check the state of the backend.
This commit is contained in:
@ -936,6 +936,23 @@ SRWBackend get_backend_from_bref(ROUTER_CLIENT_SES* rses, backend_ref_t* bref)
|
||||
return SRWBackend();
|
||||
}
|
||||
|
||||
void close_all_connections(ROUTER_CLIENT_SES* rses)
|
||||
{
|
||||
for (SRWBackendList::iterator it = rses->backends.begin();
|
||||
it != rses->backends.end(); it++)
|
||||
{
|
||||
if (BREF_IS_IN_USE((&backend_ref[i])))
|
||||
{
|
||||
SRWBackend& bref = *it;
|
||||
|
||||
if (bref->in_use())
|
||||
{
|
||||
bref->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* API function definitions
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user