mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-07 02:20:25 +08:00
将带宽限制改为流量限制
This commit is contained in:
@@ -144,9 +144,9 @@ func (this *HTTPRequest) Do() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 带宽限制
|
// 流量限制
|
||||||
if this.Server.BandwidthLimit != nil && this.Server.BandwidthLimit.IsOn && !this.Server.BandwidthLimit.IsEmpty() && this.Server.BandwidthLimitStatus != nil && this.Server.BandwidthLimitStatus.IsValid() {
|
if this.Server.TrafficLimit != nil && this.Server.TrafficLimit.IsOn && !this.Server.TrafficLimit.IsEmpty() && this.Server.TrafficLimitStatus != nil && this.Server.TrafficLimitStatus.IsValid() {
|
||||||
this.doBandwidthLimit()
|
this.doTrafficLimit()
|
||||||
this.doEnd()
|
this.doEnd()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 带宽限制
|
// 套餐过期
|
||||||
func (this *HTTPRequest) doPlanExpires() {
|
func (this *HTTPRequest) doPlanExpires() {
|
||||||
this.tags = append(this.tags, "plan")
|
this.tags = append(this.tags, "plan")
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import (
|
|||||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 带宽限制
|
// 流量限制
|
||||||
func (this *HTTPRequest) doBandwidthLimit() {
|
func (this *HTTPRequest) doTrafficLimit() {
|
||||||
var config = this.Server.BandwidthLimit
|
var config = this.Server.TrafficLimit
|
||||||
|
|
||||||
this.tags = append(this.tags, "bandwidth")
|
this.tags = append(this.tags, "bandwidth")
|
||||||
|
|
||||||
@@ -19,6 +19,6 @@ func (this *HTTPRequest) doBandwidthLimit() {
|
|||||||
if len(config.NoticePageBody) != 0 {
|
if len(config.NoticePageBody) != 0 {
|
||||||
_, _ = this.writer.WriteString(config.NoticePageBody)
|
_, _ = this.writer.WriteString(config.NoticePageBody)
|
||||||
} else {
|
} else {
|
||||||
_, _ = this.writer.WriteString(serverconfigs.DefaultBandwidthLimitNoticePageBody)
|
_, _ = this.writer.WriteString(serverconfigs.DefaultTrafficLimitNoticePageBody)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user