Skip to content

Commit

Permalink
Merge pull request #3300 from fatedier/dev
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
fatedier authored Feb 9, 2023
2 parents 534dc99 + 18ab58e commit 88e74ff
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/config/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@ func (cfg *BaseProxyConf) marshalToMsg(pMsg *msg.NewProxy) {
pMsg.UseEncryption = cfg.UseEncryption
pMsg.UseCompression = cfg.UseCompression
pMsg.BandwidthLimit = cfg.BandwidthLimit.String()
pMsg.BandwidthLimitMode = cfg.BandwidthLimitMode
// leave it empty for default value to reduce traffic
if cfg.BandwidthLimitMode != "client" {
pMsg.BandwidthLimitMode = cfg.BandwidthLimitMode
}
pMsg.Group = cfg.Group
pMsg.GroupKey = cfg.GroupKey
pMsg.Metas = cfg.Metas
Expand All @@ -407,8 +410,12 @@ func (cfg *BaseProxyConf) unmarshalFromMsg(pMsg *msg.NewProxy) {
cfg.ProxyType = pMsg.ProxyType
cfg.UseEncryption = pMsg.UseEncryption
cfg.UseCompression = pMsg.UseCompression
cfg.BandwidthLimit, _ = NewBandwidthQuantity(pMsg.BandwidthLimit)
cfg.BandwidthLimitMode = pMsg.BandwidthLimitMode
if pMsg.BandwidthLimit != "" {
cfg.BandwidthLimit, _ = NewBandwidthQuantity(pMsg.BandwidthLimit)
}
if pMsg.BandwidthLimitMode != "" {
cfg.BandwidthLimitMode = pMsg.BandwidthLimitMode
}
cfg.Group = pMsg.Group
cfg.GroupKey = pMsg.GroupKey
cfg.Metas = pMsg.Metas
Expand Down

0 comments on commit 88e74ff

Please sign in to comment.