代码拉取完成,页面将自动刷新
diff --git a/frameworks/libs/distributeddb/communicator/include/frame_retainer.h b/frameworks/libs/distributeddb/communicator/include/frame_retainer.h
index 854bc0923..79837f450 100644
--- a/frameworks/libs/distributeddb/communicator/include/frame_retainer.h
+++ b/frameworks/libs/distributeddb/communicator/include/frame_retainer.h
@@ -29,14 +29,14 @@ class SerialBuffer; // Forward Declarations
struct FrameInfo {
SerialBuffer *buffer = nullptr;
std::string srcTarget;
- std::string senderUser;
+ std::string sendUser;
LabelType commLabel;
uint32_t frameId = 0u;
};
struct RetainWork {
SerialBuffer *buffer = nullptr;
- std::string senderUser;
+ std::string sendUser;
uint32_t frameId = 0u;
uint32_t remainTime = 0u; // in second
};
diff --git a/frameworks/libs/distributeddb/communicator/src/communicator.cpp b/frameworks/libs/distributeddb/communicator/src/communicator.cpp
index 2171b170a..ef60f1962 100644
--- a/frameworks/libs/distributeddb/communicator/src/communicator.cpp
+++ b/frameworks/libs/distributeddb/communicator/src/communicator.cpp
@@ -147,14 +147,14 @@ int Communicator::SendMessage(const std::string &dstTarget, const Message *inMsg
}
void Communicator::OnBufferReceive(const std::string &srcTarget, const SerialBuffer *inBuf,
- const std::string &senderUser)
+ const std::string &sendUser)
{
std::lock_guard<std::mutex> messageHandleLockGuard(messageHandleMutex_);
if (!srcTarget.empty() && inBuf != nullptr && onMessageHandle_) {
int error = E_OK;
// if error is not E_OK, null pointer will be returned
Message *message = ProtocolProto::ToMessage(inBuf, error);
- message->SetSenderUserId(senderUser);
+ message->SetSenderUserId(sendUser);
delete inBuf;
inBuf = nullptr;
// message is not nullptr if error is E_OK or error is E_NOT_REGISTER.
diff --git a/frameworks/libs/distributeddb/communicator/src/communicator.h b/frameworks/libs/distributeddb/communicator/src/communicator.h
index d58ac48a5..2a6aaf82d 100644
--- a/frameworks/libs/distributeddb/communicator/src/communicator.h
+++ b/frameworks/libs/distributeddb/communicator/src/communicator.h
@@ -56,7 +56,7 @@ public:
const OnSendEnd &onEnd) override;
// Call by CommunicatorAggregator directly
- void OnBufferReceive(const std::string &srcTarget, const SerialBuffer *inBuf, const std::string &senderUser);
+ void OnBufferReceive(const std::string &srcTarget, const SerialBuffer *inBuf, const std::string &sendUser);
// Call by CommunicatorAggregator directly
void OnConnectChange(const std::string &target, bool isConnect);
diff --git a/frameworks/libs/distributeddb/communicator/src/communicator_aggregator.cpp b/frameworks/libs/distributeddb/communicator/src/communicator_aggregator.cpp
index 24d174711..6b1fa847c 100644
--- a/frameworks/libs/distributeddb/communicator/src/communicator_aggregator.cpp
+++ b/frameworks/libs/distributeddb/communicator/src/communicator_aggregator.cpp
@@ -276,7 +276,7 @@ void CommunicatorAggregator::ActivateCommunicator(const LabelType &commLabel, co
// Do Redeliver, the communicator is responsible to deal with the frame
std::list<FrameInfo> framesToRedeliver = retainer_.FetchFramesForSpecificCommunicator(commLabel);
for (auto &entry : framesToRedeliver) {
- commMap_[userId].at(commLabel).first->OnBufferReceive(entry.srcTarget, entry.buffer, entry.senderUser);
+ commMap_[userId].at(commLabel).first->OnBufferReceive(entry.srcTarget, entry.buffer, entry.sendUser);
}
}
@@ -683,7 +683,8 @@ int CommunicatorAggregator::OnAppLayerFrameReceive(const ReceiveBytesInfo &recei
if (receiveBytesInfo.headLength != 0) {
int ret = GetDataUserId(inResult, toLabel, userInfoProc, receiveBytesInfo.srcTarget, userInfo);
if (ret != E_OK || userInfo.receiveUser.empty() || userInfo.sendUser.empty()) {
- LOGE("[CommAggr][AppReceive] get data user id err, ret=%d", ret);
+ LOGE("[CommAggr][AppReceive] get data user id err, ret=%d, empty receiveUser=%d, empty sendUser=%d", ret,
+ userInfo.receiveUser.empty(), userInfo.sendUser.empty());
delete inFrameBuffer;
inFrameBuffer = nullptr;
return ret != E_OK ? ret : -E_NO_TRUSTED_USER;
@@ -758,10 +759,10 @@ int CommunicatorAggregator::TryDeliverAppLayerFrameToCommunicatorNoMutex(const s
SerialBuffer *&inFrameBuffer, const LabelType &toLabel, const UserInfo &userInfo)
{
// Ignore nonactivated communicator, which is regarded as inexistent
- const std::string &senderUser = userInfo.sendUser;
+ const std::string &sendUser = userInfo.sendUser;
const std::string &receiveUser = userInfo.receiveUser;
if (commMap_[receiveUser].count(toLabel) != 0 && commMap_[receiveUser].at(toLabel).second) {
- commMap_[receiveUser].at(toLabel).first->OnBufferReceive(srcTarget, inFrameBuffer, senderUser);
+ commMap_[receiveUser].at(toLabel).first->OnBufferReceive(srcTarget, inFrameBuffer, sendUser);
// Frame handed over to communicator who is responsible to delete it. The frame is deleted here after return.
inFrameBuffer = nullptr;
return E_OK;
@@ -783,7 +784,7 @@ int CommunicatorAggregator::TryDeliverAppLayerFrameToCommunicatorNoMutex(const s
}
}
if (communicator != nullptr && (receiveUser.empty() || isEmpty)) {
- communicator->OnBufferReceive(srcTarget, inFrameBuffer, senderUser);
+ communicator->OnBufferReceive(srcTarget, inFrameBuffer, sendUser);
inFrameBuffer = nullptr;
return E_OK;
}
diff --git a/frameworks/libs/distributeddb/communicator/src/frame_retainer.cpp b/frameworks/libs/distributeddb/communicator/src/frame_retainer.cpp
index c51fec9ed..b1b42011e 100644
--- a/frameworks/libs/distributeddb/communicator/src/frame_retainer.cpp
+++ b/frameworks/libs/distributeddb/communicator/src/frame_retainer.cpp
@@ -85,7 +85,7 @@ void FrameRetainer::RetainFrame(const FrameInfo &inFrame)
if (inFrame.buffer == nullptr) {
return; // Never gonna happen
}
- RetainWork work{inFrame.buffer, inFrame.senderUser, inFrame.frameId, MAX_RETAIN_TIME};
+ RetainWork work{inFrame.buffer, inFrame.sendUser, inFrame.frameId, MAX_RETAIN_TIME};
if (work.buffer->GetSize() > MAX_RETAIN_FRAME_SIZE) {
LOGE("[Retainer][Retain] Frame size=%u over limit=%u.", work.buffer->GetSize(), MAX_RETAIN_FRAME_SIZE);
delete work.buffer;
@@ -140,7 +140,7 @@ std::list<FrameInfo> FrameRetainer::FetchFramesForSpecificCommunicator(const Lab
for (auto &entry : fetchOrder) {
RetainWork &work = perLabel[entry.second][entry.first];
LogRetainInfo("[Retainer][Fetch] FETCH-OUT", inCommLabel, entry.second, entry.first, work);
- outFrameList.emplace_back(FrameInfo{work.buffer, entry.second, work.senderUser, inCommLabel, work.frameId});
+ outFrameList.emplace_back(FrameInfo{work.buffer, entry.second, work.sendUser, inCommLabel, work.frameId});
// Update statistics
totalSizeByByte_ -= work.buffer->GetSize();
totalRetainFrames_--;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。