From 3943f75bc53c8cff222311768286a828861f4a1c Mon Sep 17 00:00:00 2001 From: arm64v8a <48624112+arm64v8a@users.noreply.github.com> Date: Thu, 27 Oct 2022 18:47:05 +0900 Subject: [PATCH] fix tagOut --- db/ConfigBuilder.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/db/ConfigBuilder.cpp b/db/ConfigBuilder.cpp index d071585..445f4c3 100644 --- a/db/ConfigBuilder.cpp +++ b/db/ConfigBuilder.cpp @@ -321,6 +321,7 @@ namespace NekoRay { QString BuildChainInternal(int chainId, const QList> &ents, const QSharedPointer &status) { QString chainTag = "c-" + Int2String(chainId); + QString chainTagOut; bool muxApplied = false; QString pastTag; @@ -340,9 +341,11 @@ namespace NekoRay { if (index == ents.length() - 1) { needGlobal = true; tagOut = "g-" + Int2String(ent->id); - if (chainId == 0) { - tagOut = "proxy"; - } + } + + // last profile set as "proxy" + if (chainId == 0 && index == 0) { + tagOut = "proxy"; } if (needGlobal) { @@ -376,7 +379,7 @@ namespace NekoRay { } } else { // index == 0 means last profile in chain / not chain - chainTag = tagOut; + chainTagOut = tagOut; status->result->outboundStat = ent->traffic_data; } @@ -522,7 +525,7 @@ namespace NekoRay { index++; } - return chainTag; + return chainTagOut; } // SingBox