From d4aa0f7b478639d13a006bdc0fe3dc213ce73535 Mon Sep 17 00:00:00 2001 From: Charlie Qiu Date: Tue, 17 Jan 2017 01:42:05 +0800 Subject: [PATCH] [BUG] Fix #210 Duplicating KCPTUN enabled profiles does not copy KCPTUN related settings --- ShadowsocksX-NG/KcptunProfile.swift | 3 ++- ShadowsocksX-NG/ServerProfile.swift | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ShadowsocksX-NG/KcptunProfile.swift b/ShadowsocksX-NG/KcptunProfile.swift index 110e4da..5e661cf 100644 --- a/ShadowsocksX-NG/KcptunProfile.swift +++ b/ShadowsocksX-NG/KcptunProfile.swift @@ -9,7 +9,7 @@ import Foundation -class KcptunProfile: NSObject { +class KcptunProfile: NSObject, NSCopying { var mode: String = "fast" @@ -29,6 +29,7 @@ class KcptunProfile: NSObject { copy.nocomp = self.nocomp copy.datashard = self.datashard copy.parityshard = self.parityshard + copy.mtu = self.mtu return copy; } diff --git a/ShadowsocksX-NG/ServerProfile.swift b/ShadowsocksX-NG/ServerProfile.swift index 752583c..8b2ec4a 100644 --- a/ShadowsocksX-NG/ServerProfile.swift +++ b/ShadowsocksX-NG/ServerProfile.swift @@ -101,6 +101,9 @@ class ServerProfile: NSObject, NSCopying { copy.password = self.password copy.remark = self.remark copy.ota = self.ota + + copy.enabledKcptun = self.enabledKcptun + copy.kcptunProfile = self.kcptunProfile.copy() as! KcptunProfile return copy; }