Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't list routers until session is available #759

Closed
wants to merge 11 commits into from
8 changes: 4 additions & 4 deletions library/bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,16 @@ static void get_service_cb(ziti_context ztx, const ziti_service *service, int st
conn->server.srv_routers_api_missing = false;
}

if (!conn->server.srv_routers_api_missing) {
ziti_ctrl_list_service_routers(ztx_get_controller(ztx), service, list_routers_cb, conn);
}

conn->encrypted = service->encryption;
if (conn->server.token == NULL) {
ziti_ctrl_create_session(ztx_get_controller(ztx), service->id, ziti_session_types.Bind, session_cb, conn);
} else if (conn->server.srv_routers_api_missing) {
ziti_ctrl_get_session(ztx_get_controller(ztx), conn->server.session->id, session_cb, conn);
}

if (!conn->server.srv_routers_api_missing) {
ziti_ctrl_list_service_routers(ztx_get_controller(ztx), service, list_routers_cb, conn);
}
}

static uint16_t get_terminator_cost(const ziti_listen_opts *opts, const char *service, ziti_context ztx) {
Expand Down
Loading