fix:修正未出初始化的变量。

This commit is contained in:
taynpg 2025-05-13 19:29:42 +08:00
parent d0d1c2b36a
commit 4ca6ded5b6
4 changed files with 12 additions and 5 deletions

View File

@ -38,6 +38,7 @@ bool ClientCore::Connect(const wxString& host, uint16_t port)
if (recvThread_.joinable()) {
recvThread_.join();
}
thRun_ = true;
recvThread_ = std::thread(&ClientCore::Recv, this);
return true;
}
@ -119,6 +120,7 @@ void ClientCore::UseFrame(FrameBuffer* buf)
InfoClientVec vec;
ZeroCopyInput input(buf->dataMut, buf->len);
input.archive() >> vec;
logCall_(wxString::Format(_("Online clients: %d."), static_cast<int>(vec.vec.size())));
if (onlineCallback_) {
onlineCallback_(vec);
}

View File

@ -6,7 +6,8 @@
#include <cereal/types/vector.hpp>
#include <cstdint>
constexpr int GBUFFER_SIZE = 256;
//constexpr int GBUFFER_SIZE = 256;
constexpr int GBUFFER_SIZE = 1024 * 1024;
struct InfoCommunicate {
std::string UUID;

View File

@ -163,8 +163,8 @@ void RelayServer::ReplyRequest(const sockPtr& wxSock, FrameBuffer* frame)
{
switch (frame->dataType) {
case FBT_SER_MSG_ASKCLIENTS: {
RpyOnline(wxSock, frame);
wxLogMessage(wxT("Reply clients to %s clients list."), frame->fid);
bool r = RpyOnline(wxSock, frame);
wxLogMessage(wxT("Reply clients to %s clients list, ret = %d."), frame->fid, r);
break;
}
default:
@ -222,7 +222,8 @@ bool RelayServer::Send(const sockPtr& wxSock, FrameBuffer* buf)
}
wxSock->Write(od, odLen);
if (wxSock->Error()) {
auto sendCnt = wxSock->LastCount();
if (sendCnt != odLen) {
delete[] od;
wxLogError(wxT("Send error: %s"), wxSock->LastError());
return false;

View File

@ -34,6 +34,9 @@ void test1()
cereal::BinaryInputArchive inputArchive(inputSs);
inputArchive(info2);
}
std::cout << "info2.lastModifyTime: " << info2.lastModifyTime << "\n";
std::cout << "info2.permission: " << info2.permission << "\n";
}
void test2()