MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / Close

Method Close

internal/nodes/http_request.go:1634–1652  ·  view source on GitHub ↗

Close 关闭连接

()

Source from the content-addressed store, hash-verified

1632
1633// Close 关闭连接
1634func (this *HTTPRequest) Close() {
1635 this.Done()
1636
1637 var requestConn = this.RawReq.Context().Value(HTTPConnContextKey)
1638 if requestConn == nil {
1639 return
1640 }
1641
1642 lingerConn, ok := requestConn.(LingerConn)
1643 if ok {
1644 _ = lingerConn.SetLinger(0)
1645 }
1646
1647 conn, ok := requestConn.(net.Conn)
1648 if ok {
1649 _ = conn.Close()
1650 return
1651 }
1652}
1653
1654// Allow 放行
1655func (this *HTTPRequest) Allow() {

Callers 4

doMismatchMethod · 0.95
doRequestLimitMethod · 0.95
doWAFRequestMethod · 0.95
WAFCloseMethod · 0.95

Calls 4

DoneMethod · 0.95
ContextMethod · 0.80
SetLingerMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected