Skip to content

Commit

Permalink
bsock: beautyfied comments
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Aug 16, 2018
1 parent 92f870a commit a5ca64b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 52 deletions.
22 changes: 11 additions & 11 deletions core/src/lib/bsock_tcp.cc
Expand Up @@ -928,38 +928,38 @@ void BareosSocketTCP::close()

void BareosSocketTCP::destroy()
{
if (msg) {
/* if this object is cloned
* some memory or file descriptors
* are duplicated not just copied */

if (msg) { /* duplicated */
FreePoolMemory(msg);
msg = nullptr;
}
if (errmsg) {
if (errmsg) { /* duplicated */
FreePoolMemory(errmsg);
errmsg = nullptr;
}
if (who_) {
if (who_) { /* duplicated */
free(who_);
who_ = nullptr;
}
if (host_) {
if (host_) { /* duplicated */
free(host_);
host_ = nullptr;
}
if (src_addr) {
if (src_addr) { /* duplicated */
free(src_addr);
src_addr = nullptr;
}
if (fd_ >= 0) {
if (fd_ >= 0) { /* duplicated */
socketClose(fd_);
fd_ = -1;
}
if(spool_fd_ >= 0) {
if(spool_fd_ >= 0) { /* duplicated */
socketClose(spool_fd_);
spool_fd_ = -1;
}
if(src_addr) {
delete (src_addr);
src_addr = nullptr;
}
}

/*
Expand Down
29 changes: 0 additions & 29 deletions core/src/lib/tls_conf_cert.cc
Expand Up @@ -34,35 +34,6 @@ uint32_t TlsConfigCert::GetPolicy() const
return result << TlsConfigCert::policy_offset;
}


//std::shared_ptr<TLS_IMPLEMENTATION> TlsConfigCert::CreateClientContext() const
//{
// return new_tls_context((!CaCertfile || CaCertfile->empty()) ? nullptr : CaCertfile->c_str(),
// (!CaCertdir || CaCertdir->empty()) ? nullptr : CaCertdir->c_str(),
// (!crlfile || crlfile->empty()) ? nullptr : crlfile->c_str(),
// (!certfile || certfile->empty()) ? nullptr : certfile->c_str(),
// (!keyfile || keyfile->empty()) ? nullptr : keyfile->c_str(),
// TlsPemCallback,
// (!pem_message || pem_message->empty()) ? nullptr : pem_message->c_str(),
// nullptr,
// (!cipherlist || cipherlist->empty()) ? nullptr : cipherlist->c_str(),
// VerifyPeer);
//}
//
//std::shared_ptr<TLS_IMPLEMENTATION> TlsConfigCert::CreateServerContext() const
//{
// return new_tls_context((!CaCertfile || CaCertfile->empty()) ? nullptr : CaCertfile->c_str(),
// (!CaCertdir || CaCertdir->empty()) ? nullptr : CaCertdir->c_str(),
// (!crlfile || crlfile->empty()) ? nullptr : crlfile->c_str(),
// (!certfile || certfile->empty()) ? nullptr : certfile->c_str(),
// (!keyfile || keyfile->empty()) ? nullptr : keyfile->c_str(),
// TlsPemCallback,
// (!pem_message || pem_message->empty()) ? nullptr : pem_message->c_str(),
// nullptr,
// (!cipherlist || cipherlist->empty()) ? nullptr : cipherlist->c_str(),
// VerifyPeer);
//}

bool TlsConfigCert::enabled(u_int32_t policy)
{
return ((policy >> TlsConfigCert::policy_offset) & BNET_TLS_ENABLED) == BNET_TLS_ENABLED;
Expand Down
12 changes: 0 additions & 12 deletions core/src/lib/tls_conf_psk.cc
Expand Up @@ -45,18 +45,6 @@ bool TlsConfigPsk::required(u_int32_t policy)
return ((policy >> TlsConfigPsk::policy_offset) & BNET_TLS_REQUIRED) == BNET_TLS_REQUIRED;
}

//std::shared_ptr<TLS_IMPLEMENTATION> TlsConfigPsk::CreateClientContext() const
//{
// ASSERT(psk_credentials_);
// return new_tls_psk_client_context(cipherlist, psk_credentials_);
//}
//
//std::shared_ptr<TLS_IMPLEMENTATION> TlsConfigPsk::CreateServerContext() const
//{
// ASSERT(psk_credentials_);
// return new_tls_psk_server_context(cipherlist, psk_credentials_);
//}

TlsConfigPsk::~TlsConfigPsk()
{
if (cipherlist != nullptr) {
Expand Down

0 comments on commit a5ca64b

Please sign in to comment.