mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-04-20 08:05:18 +08:00
优化请求限制逻辑,连接关闭时自动终止内容发送
This commit is contained in:
@@ -132,7 +132,7 @@ func (this *HTTPWriter) Prepare(resp *http.Response, size int64, status int, ena
|
||||
this.req.web.RequestLimit != nil &&
|
||||
this.req.web.RequestLimit.IsOn &&
|
||||
this.req.web.RequestLimit.OutBandwidthPerConnBytes() > 0 {
|
||||
this.writer = writers.NewRateLimitWriter(this.writer, this.req.web.RequestLimit.OutBandwidthPerConnBytes())
|
||||
this.writer = writers.NewRateLimitWriter(this.req.RawReq.Context(), this.writer, this.req.web.RequestLimit.OutBandwidthPerConnBytes())
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user