mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-06 10:00:25 +08:00
WAF和其他请求关闭连接时更加快速
This commit is contained in:
@@ -1428,11 +1428,16 @@ func (this *HTTPRequest) Done() {
|
||||
func (this *HTTPRequest) Close() {
|
||||
this.Done()
|
||||
|
||||
requestConn := this.RawReq.Context().Value(HTTPConnContextKey)
|
||||
var requestConn = this.RawReq.Context().Value(HTTPConnContextKey)
|
||||
if requestConn == nil {
|
||||
return
|
||||
}
|
||||
|
||||
lingerConn, ok := requestConn.(LingerConn)
|
||||
if ok {
|
||||
_ = lingerConn.SetLinger(0)
|
||||
}
|
||||
|
||||
conn, ok := requestConn.(net.Conn)
|
||||
if ok {
|
||||
_ = conn.Close()
|
||||
|
||||
Reference in New Issue
Block a user