ext/libcouchbase/src/nodeinfo.cc in libcouchbase-0.0.7 vs ext/libcouchbase/src/nodeinfo.cc in libcouchbase-0.0.8
- old
+ new
@@ -68,11 +68,11 @@
mode = LCBVB_SVCMODE_PLAIN;
}
if (type & LCB_NODE_HTCONFIG) {
if (type & LCB_NODE_CONNECTED) {
- const lcb_host_t *host = lcb_confmon_get_rest_host(instance->confmon);
+ const lcb_host_t *host = lcb::clconfig::http_get_host(instance->confmon);
if (host) {
return mk_scratch_host(instance, host);
} else {
return return_badhost(type);
}
@@ -99,23 +99,19 @@
return return_badhost(type);
}
return ensure_scratch(instance).append(hp).c_str();
}
} else if (type & (LCB_NODE_DATA|LCB_NODE_VIEWS)) {
- const mc_SERVER *server;
ix %= LCBT_NSERVERS(instance);
- server = LCBT_GET_SERVER(instance, ix);
+ const lcb::Server *server = instance->get_server(ix);
- if ((type & LCB_NODE_CONNECTED) && server->connctx == NULL) {
+ if ((type & LCB_NODE_CONNECTED) && !server->is_connected()) {
return return_badhost(type);
}
- if (server->curhost == NULL) {
- return return_badhost(type);
- }
/* otherwise, return the actual host:port of the server */
if (type & LCB_NODE_DATA) {
- return mk_scratch_host(instance, server->curhost);
+ return mk_scratch_host(instance, &server->get_host());
} else {
return lcbvb_get_hostport(vbc, ix, LCBVB_SVCTYPE_VIEWS, mode);
}
} else {
return NULL; /* don't know the type */