From 4ac581bf928bc356e47decf3a38fa7274b13be7e Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 9 Nov 2021 17:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E5=B8=A6=E5=AE=BD=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=B5=81=E9=87=8F=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request.go | 6 +++--- internal/nodes/http_request_plan_expires.go | 2 +- ...t_bandwidth_limit.go => http_request_traffic_limit.go} | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) rename internal/nodes/{http_request_bandwidth_limit.go => http_request_traffic_limit.go} (68%) diff --git a/internal/nodes/http_request.go b/internal/nodes/http_request.go index 9d3a6b7..1569221 100644 --- a/internal/nodes/http_request.go +++ b/internal/nodes/http_request.go @@ -144,9 +144,9 @@ func (this *HTTPRequest) Do() { return } - // 带宽限制 - if this.Server.BandwidthLimit != nil && this.Server.BandwidthLimit.IsOn && !this.Server.BandwidthLimit.IsEmpty() && this.Server.BandwidthLimitStatus != nil && this.Server.BandwidthLimitStatus.IsValid() { - this.doBandwidthLimit() + // 流量限制 + if this.Server.TrafficLimit != nil && this.Server.TrafficLimit.IsOn && !this.Server.TrafficLimit.IsEmpty() && this.Server.TrafficLimitStatus != nil && this.Server.TrafficLimitStatus.IsValid() { + this.doTrafficLimit() this.doEnd() return } diff --git a/internal/nodes/http_request_plan_expires.go b/internal/nodes/http_request_plan_expires.go index 622dd22..45e1184 100644 --- a/internal/nodes/http_request_plan_expires.go +++ b/internal/nodes/http_request_plan_expires.go @@ -7,7 +7,7 @@ import ( "net/http" ) -// 带宽限制 +// 套餐过期 func (this *HTTPRequest) doPlanExpires() { this.tags = append(this.tags, "plan") diff --git a/internal/nodes/http_request_bandwidth_limit.go b/internal/nodes/http_request_traffic_limit.go similarity index 68% rename from internal/nodes/http_request_bandwidth_limit.go rename to internal/nodes/http_request_traffic_limit.go index 979bf8c..08663b5 100644 --- a/internal/nodes/http_request_bandwidth_limit.go +++ b/internal/nodes/http_request_traffic_limit.go @@ -6,9 +6,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" ) -// 带宽限制 -func (this *HTTPRequest) doBandwidthLimit() { - var config = this.Server.BandwidthLimit +// 流量限制 +func (this *HTTPRequest) doTrafficLimit() { + var config = this.Server.TrafficLimit this.tags = append(this.tags, "bandwidth") @@ -19,6 +19,6 @@ func (this *HTTPRequest) doBandwidthLimit() { if len(config.NoticePageBody) != 0 { _, _ = this.writer.WriteString(config.NoticePageBody) } else { - _, _ = this.writer.WriteString(serverconfigs.DefaultBandwidthLimitNoticePageBody) + _, _ = this.writer.WriteString(serverconfigs.DefaultTrafficLimitNoticePageBody) } }