optimize code

This commit is contained in:
arm64v8a
2023-05-25 13:37:52 +09:00
parent ea993d8249
commit d7a8b939f3
5 changed files with 32 additions and 9 deletions

View File

@@ -622,7 +622,7 @@ namespace NekoGui {
status->result->outboundStats += ent->traffic_data;
// mux common
auto needMux = ent->type == "vmess" || ent->type == "trojan" || ent->type == "vless" || ent->type == "shadowsocks";
auto needMux = ent->type == "vmess" || ent->type == "trojan" || ent->type == "vless";
needMux &= dataStore->mux_concurrency > 0;
if (stream != nullptr) {
@@ -637,17 +637,13 @@ namespace NekoGui {
}
if (stream->multiplex_status == 0) {
if (!dataStore->mux_default_on) needMux = false;
} else if (stream->multiplex_status == 1) {
needMux = true;
} else if (stream->multiplex_status == 2) {
needMux = false;
}
}
if (ent->type == "shadowsocks") {
if (!IS_NEKO_BOX || outbound["udp_over_tcp"] == true || !outbound["plugin"].isNull()) {
needMux = false;
}
}
// common
if (IS_NEKO_BOX) {
// apply domain_strategy