From acd0a07e8deeff2da804fb53fa6f964901b896df Mon Sep 17 00:00:00 2001 From: Lai Zenan Date: Sat, 23 Mar 2024 18:45:01 +0800 Subject: [PATCH] fix: incompatible clash config parse --- src/parser/subparser.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/parser/subparser.cpp b/src/parser/subparser.cpp index e7a746371f..6fe807858d 100644 --- a/src/parser/subparser.cpp +++ b/src/parser/subparser.cpp @@ -162,9 +162,21 @@ void hysteriaConstruct( node.Ports = ports; node.Protocol = protocol; node.OBFSParam = obfs_protocol; - node.Up = up; + if (!up.empty()) + { + if (up.find("bps") == up.length() - 3) + node.Up = up; + else if (to_int(up)) + node.Up = up + " Mbps"; + } node.UpSpeed = to_int(up_speed); - node.Down = down; + if (!down.empty()) + { + if (down.find("bps") == down.length() - 3) + node.Down = down; + else if (to_int(down)) + node.Down = down + " Mbps"; + } node.DownSpeed = to_int(down_speed); node.AuthStr = auth_str; if (!auth.empty())