diff --git a/fbpcf/engine/communication/SocketPartyCommunicationAgent.cpp b/fbpcf/engine/communication/SocketPartyCommunicationAgent.cpp index c5c165ea..5718483c 100644 --- a/fbpcf/engine/communication/SocketPartyCommunicationAgent.cpp +++ b/fbpcf/engine/communication/SocketPartyCommunicationAgent.cpp @@ -59,6 +59,7 @@ SocketPartyCommunicationAgent::SocketPartyCommunicationAgent( std::string tlsDir, std::shared_ptr recorder) : recorder_(recorder), ssl_(nullptr) { + XLOG(INFO) << "In old constructor as server"; if (useTls) { openServerPortWithTls(sockFd, portNo, tlsDir); } else { @@ -72,6 +73,7 @@ SocketPartyCommunicationAgent::SocketPartyCommunicationAgent( TlsInfo tlsInfo, std::shared_ptr recorder) : recorder_(recorder), ssl_(nullptr), tlsInfo_(tlsInfo) { + XLOG(INFO) << "In new constructor as server"; if (tlsInfo.useTls) { openServerPortWithTls(sockFd, portNo, tlsInfo); } else { @@ -86,6 +88,7 @@ SocketPartyCommunicationAgent::SocketPartyCommunicationAgent( std::string tlsDir, std::shared_ptr recorder) : recorder_(recorder), ssl_(nullptr) { + XLOG(INFO) << "In old constructor as client"; if (useTls) { openClientPortWithTls(serverAddress, portNo, tlsDir); } else { @@ -99,6 +102,7 @@ SocketPartyCommunicationAgent::SocketPartyCommunicationAgent( TlsInfo tlsInfo, std::shared_ptr recorder) : recorder_(recorder), ssl_(nullptr), tlsInfo_(tlsInfo) { + XLOG(INFO) << "In new constructor as client"; if (tlsInfo.useTls) { openClientPortWithTls(serverAddress, portNo, tlsInfo); } else { diff --git a/fbpcf/engine/communication/SocketPartyCommunicationAgentFactory.cpp b/fbpcf/engine/communication/SocketPartyCommunicationAgentFactory.cpp index 590f576e..37ff5a8b 100644 --- a/fbpcf/engine/communication/SocketPartyCommunicationAgentFactory.cpp +++ b/fbpcf/engine/communication/SocketPartyCommunicationAgentFactory.cpp @@ -15,6 +15,7 @@ namespace fbpcf::engine::communication { std::unique_ptr SocketPartyCommunicationAgentFactory::create(int id, std::string name) { + XLOGF(INFO, "Create called with {}", tlsInfo_.useTls); if (id == myId_) { throw std::runtime_error("No need to talk to myself!"); } else { @@ -33,11 +34,11 @@ SocketPartyCommunicationAgentFactory::create(int id, std::string name) { auto [socket, portNo] = createSocketFromMaybeFreePort(assignedPortNo); iter->second.second->sendSingleT(portNo); return std::make_unique( - socket, portNo, useTls_, tlsDir_, recorder); + socket, portNo, tlsInfo_, recorder); } else { auto portNo = iter->second.second->receiveSingleT(); return std::make_unique( - iter->second.first.address, portNo, useTls_, tlsDir_, recorder); + iter->second.first.address, portNo, tlsInfo_, recorder); } } } @@ -112,7 +113,7 @@ void SocketPartyCommunicationAgentFactory::setupInitialConnection( std::make_pair( item.second, std::make_unique( - socket, item.second.portNo, useTls_, tlsDir_, recorder))}); + socket, item.second.portNo, tlsInfo_, recorder))}); } else if (myId_ > item.first) { auto recorder = @@ -127,8 +128,7 @@ void SocketPartyCommunicationAgentFactory::setupInitialConnection( std::make_unique( item.second.address, item.second.portNo, - useTls_, - tlsDir_, + tlsInfo_, recorder))}); } } diff --git a/fbpcf/engine/communication/SocketPartyCommunicationAgentFactory.h b/fbpcf/engine/communication/SocketPartyCommunicationAgentFactory.h index a5b56f11..d7f31087 100644 --- a/fbpcf/engine/communication/SocketPartyCommunicationAgentFactory.h +++ b/fbpcf/engine/communication/SocketPartyCommunicationAgentFactory.h @@ -60,6 +60,7 @@ establishing multiple connections (>3) between each party pair. tlsInfo.keyPath = ""; tlsInfo.passphrasePath = ""; tlsInfo_ = tlsInfo; + XLOGF(INFO, "factory initialized with {}", tlsInfo_.useTls); } SocketPartyCommunicationAgentFactory( @@ -79,6 +80,7 @@ establishing multiple connections (>3) between each party pair. tlsInfo.keyPath = tlsDir + "/key.pem"; tlsInfo.passphrasePath = tlsDir + "/passphrase.pem"; tlsInfo_ = tlsInfo; + XLOGF(INFO, "factory initialized with {}", tlsInfo_.useTls); } SocketPartyCommunicationAgentFactory(