From 7c8e2433992aac41bdeb0d7d0861b738d9866628 Mon Sep 17 00:00:00 2001 From: lichao <lichao@aiotlink.com> Date: 星期二, 01 六月 2021 17:34:29 +0800 Subject: [PATCH] use default if request port is 0. --- box/center.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/box/center.cpp b/box/center.cpp index 86ad999..020d1bf 100644 --- a/box/center.cpp +++ b/box/center.cpp @@ -104,7 +104,11 @@ center->PassRemoteReplyToLocal(dest, head, std::move(body_content)); } }; - if (!tcp_proxy.Request(head.dest().ip(), head.dest().port(), msg.content(), onResult)) { + uint16_t port = head.dest().port(); + if (port == 0) { + port = kBHCenterPort; + } + if (!tcp_proxy.Request(head.dest().ip(), port, msg.content(), onResult)) { replyer(MakeReply<Reply>(eError, "send request failed.")); } else { // success -- Gitblit v1.8.0