mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-09 15:09:49 +03:00
Fix subscription custom configs ignoring custom config socks port (#10296)
* Fix subscription custom configs ignoring custom config socks port Full Xray/sing-box configs imported from a subscription no longer got the subscription's "Custom config socks port" (SubItem.PreSocksPort) aftereff5845and9638b4c. 7.24.4 and earlier copied it onto every imported config, and the Clash, Hysteria2 and raw-file paths still do. Without it, GetPreSocksItem builds no pre-socks core for these profiles, so they cannot be used in TUN mode. Setting the port on the profile is not a workaround, because every subscription update re-creates the profiles. * Add regression test for subscription custom config socks port
This commit is contained in:
@@ -1778,7 +1778,7 @@ public static class ConfigHandler
|
||||
}
|
||||
if (lstProfiles.Count > 0)
|
||||
{
|
||||
var count = await AddBatchCustomServers(config, lstProfiles, subid, isSub);
|
||||
var count = await AddBatchCustomServers(config, lstProfiles, subid, isSub, subItem);
|
||||
if (count > 0)
|
||||
{
|
||||
return count;
|
||||
@@ -1824,7 +1824,7 @@ public static class ConfigHandler
|
||||
|
||||
if (lstProfiles?.Count > 0)
|
||||
{
|
||||
var count = await AddBatchCustomServers(config, lstProfiles, subid, isSub);
|
||||
var count = await AddBatchCustomServers(config, lstProfiles, subid, isSub, subItem);
|
||||
if (count > 0)
|
||||
{
|
||||
return count;
|
||||
@@ -1838,7 +1838,8 @@ public static class ConfigHandler
|
||||
Config config,
|
||||
List<ProfileItem> lstProfiles,
|
||||
string subid,
|
||||
bool isSub)
|
||||
bool isSub,
|
||||
SubItem? subItem)
|
||||
{
|
||||
var count = 0;
|
||||
foreach (var it in lstProfiles)
|
||||
@@ -1848,6 +1849,7 @@ public static class ConfigHandler
|
||||
|
||||
if (it.ConfigType == EConfigType.Custom)
|
||||
{
|
||||
it.PreSocksPort = subItem?.PreSocksPort;
|
||||
if (await AddCustomServer(config, it, true) == 0)
|
||||
{
|
||||
count++;
|
||||
|
||||
Reference in New Issue
Block a user