Skip to content

Commit

Permalink
console: removed a dynamic_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Sep 12, 2018
1 parent d3ce8ac commit cfbf334
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/console/console.cc
Expand Up @@ -999,18 +999,18 @@ BareosSocket *ConnectToDirector(JobControlRecord &jcr, utime_t heart_beat, char

const char *name;
s_password *password = NULL;
TlsResource *tls_configuration;

TlsResource *local_tls_resource;
if (console_resource) {
name = console_resource->name();
ASSERT(console_resource->password.encoding == p_encoding_md5);
password = &console_resource->password;
tls_configuration = dynamic_cast<TlsResource *>(console_resource);
local_tls_resource = console_resource;
} else { /* default console */
name = "*UserAgent*";
ASSERT(director_resource->password.encoding == p_encoding_md5);
password = &director_resource->password;
tls_configuration = dynamic_cast<TlsResource *>(director_resource);
local_tls_resource = director_resource;
}

std::string qualified_resource_name;
Expand All @@ -1021,7 +1021,7 @@ BareosSocket *ConnectToDirector(JobControlRecord &jcr, utime_t heart_beat, char
return nullptr;
}

if (!UA_sock->DoTlsHandshake(4, tls_configuration, false, qualified_resource_name.c_str(), password->value,
if (!UA_sock->DoTlsHandshake(4, local_tls_resource, false, qualified_resource_name.c_str(), password->value,
&jcr)) {
sendit(errmsg);
TerminateConsole(0);
Expand Down

0 comments on commit cfbf334

Please sign in to comment.