Added server references to services instead of using a raw pointers to server instances.
Changed all references to service->database to service->dbref.
This commit is contained in:
Markus Makela
2015-01-02 20:28:26 +02:00
parent ef19b9e729
commit 95cd0b93cb
8 changed files with 68 additions and 48 deletions

View File

@ -121,7 +121,7 @@ GWBUF *buf;
return;
}
client->session = router->session;
if ((router->master = dcb_connect(router->service->databases, router->session, BLR_PROTOCOL)) == NULL)
if ((router->master = dcb_connect(router->service->dbref->server, router->session, BLR_PROTOCOL)) == NULL)
{
char *name;
if ((name = malloc(strlen(router->service->name)
@ -135,10 +135,10 @@ GWBUF *buf;
router->retry_backoff = BLR_MAX_BACKOFF;
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
"Binlog router: failed to connect to master server '%s'",
router->service->databases->unique_name)));
router->service->dbref->server->unique_name)));
return;
}
router->master->remote = strdup(router->service->databases->name);
router->master->remote = strdup(router->service->dbref->server->name);
LOGIF(LM,(skygw_log_write(
LOGFILE_MESSAGE,
"%s: atempting to connect to master server %s.",