fix:修正未出初始化的变量。
This commit is contained in:
parent
d0d1c2b36a
commit
4ca6ded5b6
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -131,7 +131,7 @@ void RelayServer::thClientThread(const std::shared_ptr<wxSocketBase>& wxSock, co
|
||||
}
|
||||
}
|
||||
|
||||
bool RelayServer::Forword(const sockPtr& wxSock, FrameBuffer* buf)
|
||||
bool RelayServer::Forword(const sockPtr& wxSock, FrameBuffer* buf)
|
||||
{
|
||||
std::shared_ptr<TranClient> fcl = nullptr;
|
||||
std::shared_ptr<TranClient> tcl = nullptr;
|
||||
@ -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;
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user