Commit fc96abc5 authored by Volodymyr Yurchenko's avatar Volodymyr Yurchenko
Browse files

Pass credentials to ConnectJBox

parent 58caa378
Pipeline #957927 passed with stage
in 2 minutes and 22 seconds
......@@ -38,10 +38,10 @@ private:
const int default_WSport = 8097;
const std::string default_server = DEFAULT_JCENTRAL_SERVER;
std::string fWSHost; // websocket port
int fWSPort; // websocket port
TString sUsercert; // location of user certificate
TString sUserkey; // location of user private key
std::string fWSHost; // websocket host
int fWSPort; // websocket port
TString sUsercert; // location of user certificate
TString sUserkey; // location of user private key
// Libwebsockets
static int destroy_flag; // Flags to know connection status
......@@ -69,7 +69,7 @@ public:
TJAlienConnectionManager();
~TJAlienConnectionManager();
int CreateConnection();
void ConnectJBox();
void ConnectJBox(TJAlienCredentialsObject c);
void ConnectJCentral(TJAlienCredentialsObject c, string host = DEFAULT_JCENTRAL_SERVER);
void MakeWebsocketConnection(TJAlienCredentialsObject creds, string host, int WSPort);
void ForceRestart();
......
......@@ -45,7 +45,7 @@ int TJAlienConnectionManager::CreateConnection()
}
if (co.kind == cJBOX_TOKEN || co.kind == cJOB_TOKEN) {
ConnectJBox();
ConnectJBox(co);
}
if (connection_flag) {
......@@ -99,14 +99,8 @@ void TJAlienConnectionManager::clearFlags()
}
//______________________________________________________________________________
void TJAlienConnectionManager::ConnectJBox()
void TJAlienConnectionManager::ConnectJBox(TJAlienCredentialsObject c)
{
if (!creds.has(cJBOX_TOKEN)) {
return;
}
TJAlienCredentialsObject c = creds.get(cJBOX_TOKEN);
TJClientFile jcf;
if (jcf.isValid) {
MakeWebsocketConnection(c, (std::string)jcf.fHost, jcf.fWSPort);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment