Merge pull request #3300 from fatedier/dev

sync
This commit is contained in:
fatedier 2023-02-10 01:12:00 +08:00 committed by GitHub
commit 88e74ff24d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -396,7 +396,10 @@ func (cfg *BaseProxyConf) marshalToMsg(pMsg *msg.NewProxy) {
pMsg.UseEncryption = cfg.UseEncryption pMsg.UseEncryption = cfg.UseEncryption
pMsg.UseCompression = cfg.UseCompression pMsg.UseCompression = cfg.UseCompression
pMsg.BandwidthLimit = cfg.BandwidthLimit.String() pMsg.BandwidthLimit = cfg.BandwidthLimit.String()
// leave it empty for default value to reduce traffic
if cfg.BandwidthLimitMode != "client" {
pMsg.BandwidthLimitMode = cfg.BandwidthLimitMode pMsg.BandwidthLimitMode = cfg.BandwidthLimitMode
}
pMsg.Group = cfg.Group pMsg.Group = cfg.Group
pMsg.GroupKey = cfg.GroupKey pMsg.GroupKey = cfg.GroupKey
pMsg.Metas = cfg.Metas pMsg.Metas = cfg.Metas
@ -407,8 +410,12 @@ func (cfg *BaseProxyConf) unmarshalFromMsg(pMsg *msg.NewProxy) {
cfg.ProxyType = pMsg.ProxyType cfg.ProxyType = pMsg.ProxyType
cfg.UseEncryption = pMsg.UseEncryption cfg.UseEncryption = pMsg.UseEncryption
cfg.UseCompression = pMsg.UseCompression cfg.UseCompression = pMsg.UseCompression
if pMsg.BandwidthLimit != "" {
cfg.BandwidthLimit, _ = NewBandwidthQuantity(pMsg.BandwidthLimit) cfg.BandwidthLimit, _ = NewBandwidthQuantity(pMsg.BandwidthLimit)
}
if pMsg.BandwidthLimitMode != "" {
cfg.BandwidthLimitMode = pMsg.BandwidthLimitMode cfg.BandwidthLimitMode = pMsg.BandwidthLimitMode
}
cfg.Group = pMsg.Group cfg.Group = pMsg.Group
cfg.GroupKey = pMsg.GroupKey cfg.GroupKey = pMsg.GroupKey
cfg.Metas = pMsg.Metas cfg.Metas = pMsg.Metas