Skip to content

Commit

Permalink
code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
objeck committed Mar 3, 2025
1 parent 7e575a1 commit e8419d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions core/vm/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4032,17 +4032,19 @@ bool TrapProcessor::SockTcpSslConnect(StackProgram* program, size_t* inst, size_
IPSecureSocket::Close((SSL_CTX*)instance[0], (BIO*)instance[1], (X509*)instance[2]);

SSL_CTX* ctx; BIO* bio; X509* cert;
bool is_open = IPSecureSocket::Open(addr.c_str(), port, ctx, bio, cert);
instance[0] = (size_t)ctx;
instance[1] = (size_t)bio;
instance[2] = (size_t)cert;
instance[3] = is_open;

const bool is_open = IPSecureSocket::Open(addr.c_str(), port, ctx, bio, cert);
if(is_open) {
instance[0] = (size_t)ctx;
instance[1] = (size_t)bio;
instance[2] = (size_t)cert;
instance[3] = is_open;

#ifdef _DEBUG
std::wcout << L"# socket connect: addr='" << BytesToUnicode(addr) << L"'; instance="
<< instance << L"(" << (size_t)instance << L")" << L"; addr=" << ctx << L"|" << bio << L"("
<< (size_t)ctx << L"|" << (size_t)bio << L") #" << std::endl;
std::wcout << L"# socket connect: addr='" << BytesToUnicode(addr) << L"'; instance="
<< instance << L"(" << (size_t)instance << L")" << L"; addr=" << ctx << L"|" << bio << L"("
<< (size_t)ctx << L"|" << (size_t)bio << L") #" << std::endl;
#endif
}
}

return true;
Expand Down
Binary file not shown.

0 comments on commit e8419d9

Please sign in to comment.