This commit is contained in:
azw 2023-11-27 03:34:29 +00:00
parent 81f3b0f0a3
commit f6facb7f2e
2 changed files with 7 additions and 6 deletions

View File

@ -75,6 +75,7 @@ void MasterMgr::_SS_MS_ResponseTargetServer(f8::MsgHdr* hdr, const ss::SS_MS_Res
); );
if (!conn.expired()) { if (!conn.expired()) {
conn.lock()->ForwardClientMsgEx(req->hdr_copy); conn.lock()->ForwardClientMsgEx(req->hdr_copy);
f8::MsgHdr::Destroy(req->hdr_copy);
req->conn = conn; req->conn = conn;
req->hdr_copy = nullptr; req->hdr_copy = nullptr;
if (!req->timer_wp.expired()) { if (!req->timer_wp.expired()) {

View File

@ -137,10 +137,6 @@ void UpStream::ForwardClientMsgEx(f8::MsgHdr* hdr)
SendStockMsg(); SendStockMsg();
} }
ForwardClientMsg(hdr); ForwardClientMsg(hdr);
if (hdr->buf) {
free((char*)hdr->buf);
}
free(hdr);
} else { } else {
AddStockMsg(hdr->socket_handle, 0, nullptr, hdr); AddStockMsg(hdr->socket_handle, 0, nullptr, hdr);
} }
@ -272,7 +268,11 @@ void UpStream::AddStockMsg(unsigned short socket_handle, int msgid, ::google::pr
node->socket_handle = socket_handle; node->socket_handle = socket_handle;
node->msgid = msgid; node->msgid = msgid;
node->msg = msg; node->msg = msg;
node->hdr = hdr; if (hdr) {
node->hdr = hdr->Clone();
} else {
node->hdr = nullptr;
}
if (bot_node_) { if (bot_node_) {
bot_node_->next_node = node; bot_node_->next_node = node;
bot_node_ = node; bot_node_ = node;