Skip to content

Commit 860fcc0

Browse files
committed
complement log
1 parent 1a0970c commit 860fcc0

File tree

16 files changed

+29
-26
lines changed

16 files changed

+29
-26
lines changed

cpp/wedpr-computing/ppc-pir/src/OtPIRImpl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,11 @@ void OtPIRImpl::onReceiveMessage(ppc::front::PPCMessageFace::Ptr _msg)
149149
}
150150
}
151151

152-
void OtPIRImpl::onReceivedErrorNotification(const std::string& _taskID)
152+
void OtPIRImpl::onReceivedErrorNotification(ppc::front::PPCMessageFace::Ptr const& _message)
153153
{
154+
PIR_LOG(WARNING) << LOG_DESC("onReceivedErrorNotification") << printPPCMsg(_message);
154155
// finish the task while the peer is failed
155-
auto taskState = findPendingTask(_taskID);
156+
auto taskState = findPendingTask(_message->taskID());
156157
if (taskState)
157158
{
158159
taskState->onPeerNotifyFinish();
@@ -242,7 +243,7 @@ void OtPIRImpl::handleReceivedMessage(const ppc::front::PPCMessageFace::Ptr& _me
242243
{
243244
case int(CommonMessageType::ErrorNotification):
244245
{
245-
pir->onReceivedErrorNotification(_message->taskID());
246+
pir->onReceivedErrorNotification(_message);
246247
break;
247248
}
248249
case int(CommonMessageType::PingPeer):

cpp/wedpr-computing/ppc-pir/src/OtPIRImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class OtPIRImpl : public std::enable_shared_from_this<OtPIRImpl>,
5959
// register to the front to get the message related to ot-pir
6060
void onReceiveMessage(ppc::front::PPCMessageFace::Ptr _message) override;
6161

62-
void onReceivedErrorNotification(const std::string& _taskID) override;
62+
void onReceivedErrorNotification(ppc::front::PPCMessageFace::Ptr const& _message) override;
6363
void onSelfError(
6464
const std::string& _taskID, bcos::Error::Ptr _error, bool _noticePeer) override;
6565

cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CM2020PSIImpl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,11 @@ void CM2020PSIImpl::stop()
318318
CM2020_PSI_LOG(INFO) << LOG_DESC("CM2020-PSI stopped");
319319
}
320320

321-
void CM2020PSIImpl::onReceivedErrorNotification(const std::string& _taskID)
321+
void CM2020PSIImpl::onReceivedErrorNotification(ppc::front::PPCMessageFace::Ptr const& _message)
322322
{
323-
CM2020_PSI_LOG(INFO) << LOG_DESC("onReceivedErrorNotification") << LOG_KV("taskID", _taskID);
323+
CM2020_PSI_LOG(INFO) << LOG_DESC("onReceivedErrorNotification") << printPPCMsg(_message);
324324
// finish the task while the peer is failed
325-
auto taskState = findPendingTask(_taskID);
325+
auto taskState = findPendingTask(_message->taskID());
326326
if (taskState)
327327
{
328328
taskState->onPeerNotifyFinish();
@@ -410,7 +410,7 @@ void CM2020PSIImpl::handleReceivedMessage(const ppc::front::PPCMessageFace::Ptr&
410410
{
411411
case int(CommonMessageType::ErrorNotification):
412412
{
413-
psi->onReceivedErrorNotification(_message->taskID());
413+
psi->onReceivedErrorNotification(_message);
414414
break;
415415
}
416416
case int(CommonMessageType::PingPeer):

cpp/wedpr-computing/ppc-psi/src/cm2020-psi/CM2020PSIImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class CM2020PSIImpl : public bcos::Worker,
6262

6363
void start() override;
6464
void stop() override;
65-
void onReceivedErrorNotification(const std::string& _taskID) override;
65+
void onReceivedErrorNotification(ppc::front::PPCMessageFace::Ptr const& _message) override;
6666
void onSelfError(
6767
const std::string& _taskID, bcos::Error::Ptr _error, bool _noticePeer) override;
6868

cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/EcdhConnPSIImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void EcdhConnPSIImpl::stop()
131131
}
132132
}
133133

134-
void EcdhConnPSIImpl::onReceivedErrorNotification(const std::string& _taskID) {}
134+
void EcdhConnPSIImpl::onReceivedErrorNotification(ppc::front::PPCMessageFace::Ptr const&) {}
135135

136136
void EcdhConnPSIImpl::onSelfError(
137137
const std::string& _taskID, bcos::Error::Ptr _error, bool _noticePeer)

cpp/wedpr-computing/ppc-psi/src/ecdh-conn-psi/EcdhConnPSIImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class EcdhConnPSIImpl : public std::enable_shared_from_this<EcdhConnPSIImpl>,
6161
void start() override;
6262
void stop() override;
6363

64-
void onReceivedErrorNotification(const std::string& _taskID) override;
64+
void onReceivedErrorNotification(ppc::front::PPCMessageFace::Ptr const& _message) override;
6565
void onSelfError(
6666
const std::string& _taskID, bcos::Error::Ptr _error, bool _noticePeer) override;
6767
void executeWorker() override;

cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,11 @@ void EcdhMultiPSIImpl::checkFinishedTask()
266266
}
267267
}
268268

269-
void EcdhMultiPSIImpl::onReceivedErrorNotification(const std::string& _taskID)
269+
void EcdhMultiPSIImpl::onReceivedErrorNotification(ppc::front::PPCMessageFace::Ptr const& _message)
270270
{
271-
ECDH_MULTI_LOG(INFO) << LOG_DESC("onReceivedErrorNotification") << LOG_KV("taskID", _taskID);
271+
ECDH_MULTI_LOG(INFO) << LOG_DESC("onReceivedErrorNotification") << printPPCMsg(_message);
272272
// finish the task while the peer is failed
273-
auto taskState = findPendingTask(_taskID);
273+
auto taskState = findPendingTask(_message->taskID());
274274
if (taskState)
275275
{
276276
taskState->onPeerNotifyFinish();
@@ -308,7 +308,7 @@ void EcdhMultiPSIImpl::executeWorker()
308308
auto pop_msg = _msg.second;
309309
if (pop_msg->messageType() == uint8_t(CommonMessageType::ErrorNotification))
310310
{
311-
onReceivedErrorNotification(pop_msg->taskID());
311+
onReceivedErrorNotification(pop_msg);
312312
return;
313313
}
314314
else if (pop_msg->messageType() == uint8_t(CommonMessageType::PingPeer))

cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/EcdhMultiPSIImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class EcdhMultiPSIImpl : public std::enable_shared_from_this<EcdhMultiPSIImpl>,
4040
void stop() override;
4141

4242
void checkFinishedTask();
43-
void onReceivedErrorNotification(const std::string& _taskID) override;
43+
void onReceivedErrorNotification(ppc::front::PPCMessageFace::Ptr const& _message) override;
4444
void onSelfError(
4545
const std::string& _taskID, bcos::Error::Ptr _error, bool _noticePeer) override;
4646
void executeWorker() override;

cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSICalculator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void EcdhMultiPSICalculator::blindData(std::string _taskID, bcos::bytes _randA)
9595
uint64_t dataOffset = 0;
9696
do
9797
{
98-
if (m_taskState->loadFinished())
98+
if (m_taskState->loadFinished() || m_taskState->taskDone())
9999
{
100100
break;
101101
}

cpp/wedpr-computing/ppc-psi/src/ecdh-multi-psi/core/EcdhMultiPSIMaster.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void EcdhMultiPSIMaster::blindData()
121121
auto reader = m_taskState->reader();
122122
do
123123
{
124-
if (m_taskState->loadFinished())
124+
if (m_taskState->loadFinished() || m_taskState->taskDone())
125125
{
126126
break;
127127
}

0 commit comments

Comments
 (0)