Skip to content

Commit

Permalink
Remove NOOPs from OTServerConnection.cpp
Browse files Browse the repository at this point in the history
Remnants from the SSL mode
  • Loading branch information
OttoAllmendinger committed Nov 11, 2014
1 parent 36fea80 commit 9368810
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
3 changes: 0 additions & 3 deletions include/opentxs/client/OTServerConnection.hpp
Expand Up @@ -147,9 +147,6 @@ class OTWallet;

class OTServerConnection
{
static void Initialize();
static bool s_bInitialized;

OTMessageBuffer m_listIn;
OTMessageBuffer m_listOut;

Expand Down
35 changes: 1 addition & 34 deletions src/client/OTServerConnection.cpp
Expand Up @@ -153,29 +153,6 @@ extern "C" {
namespace opentxs
{

bool OTServerConnection::s_bInitialized = false;

void OTServerConnection::Initialize()
{
// We've already been initialized. We can just return
if (s_bInitialized) {
return;
}

// This is the first time this function has run.
s_bInitialized = true; // set this to true so the function can't run again.
// It only runs the first time.

// Initialize SSL -- MUST happen before any Private keys are loaded, if you
// want it to work.
// Update: this no longer initializes OpenSSL, which I do in
// OTLog::OT_Init() now.
// Just make sure you call that early on.
//
// SFSocketGlobalInit();
}

// Connect is used for SSL mode, but SetFocus is used for XmlRpc mode.
// Everytime you send a message, it is a new connection -- and could be to
// a different server! So it's important to switch focus each time so we
// have the right server contract, etc.
Expand All @@ -189,17 +166,7 @@ bool OTServerConnection::SetFocus(OTPseudonym& theNym,
OT_FAIL;
};

// We're already connected! You can't use SetFocus if you're in connection
// mode (TCP instead of HTTP.)
// if (IsConnected())
// return false;
//
// This call initializes OpenSSL (only the first time it's called.)
Initialize();

// The Client keeps an internal ServerConnection at all times.
// In SSL/TCP mode, you connect, and stay connected. But in RPC
// mode, you must call SetFocus before each time you prepare or
// In RPC mode, you must call SetFocus before each time you prepare or
// process any server-related messages. Why? Since the Client normally
// expects the connection to already be made, and therefore expects
// to have access to the Nym and Server Contract (and server ID, etc)
Expand Down

0 comments on commit 9368810

Please sign in to comment.