mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
optimize: smoothly migrate option portSharing from ipforward
This commit is contained in:
1 parent
859dfbd00c
commit
f76d1fd8ff
1 file changed
+9
-1
@@ -235,7 +235,15 @@ func GetSubscriptionV2(index int) *SubscriptionRawV2 {
|
||||
|
||||
func GetSettingNotNil() *Setting {
|
||||
r := new(Setting)
|
||||
_ = db.Get("system", "setting", r)
|
||||
b, e := db.GetRaw("system", "setting")
|
||||
if e == nil {
|
||||
_ = jsoniter.Unmarshal(b, r)
|
||||
// migrate
|
||||
if gjson.GetBytes(b, "ipforward").Exists() &&
|
||||
!gjson.GetBytes(b, "portSharing").Exists() {
|
||||
r.PortSharing = r.IpForward
|
||||
}
|
||||
}
|
||||
_ = common.FillEmpty(r, NewSetting())
|
||||
if r.SpecialMode == "" {
|
||||
r.SpecialMode = SpecialModeNone
|
||||
|
||||
Reference in new issue
Block a user