From 6c07fe29a5185835f28059f627a1d30e462da28b Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期二, 29 六月 2021 14:01:19 +0800 Subject: [PATCH] add notify node change. --- box/tcp_connection.cpp | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/box/tcp_connection.cpp b/box/tcp_connection.cpp index 85ed4ed..6506369 100644 --- a/box/tcp_connection.cpp +++ b/box/tcp_connection.cpp @@ -178,8 +178,17 @@ send_buffer_ = imsg.content(); async_write(socket_, Buffer(send_buffer_), TcpCBSize(*this, [this]() { Close(); })); }; + auto &scenter = *pscenter_; - if (scenter->PassRemoteRequestToLocal(remote, head, body_content, onRecv)) { + if (head.type() == kMsgTypePublish) { + auto reply = MakeReply(eSuccess); + auto rep_head = InitMsgHead(GetType(reply), scenter->id(), 0, head.msg_id()); + send_buffer_ = MsgI::Serialize(rep_head, reply); + async_write(socket_, Buffer(send_buffer_), TcpCBSize(*this, [this]() { Close(); })); + + scenter->RemotePublish(head, body_content); + return; + } else if (scenter->PassRemoteRequestToLocal(remote, head, body_content, onRecv)) { return; } else { Close(); -- Gitblit v1.8.0