Close 关闭连接
()
| 1632 | |
| 1633 | // Close 关闭连接 |
| 1634 | func (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 放行 |
| 1655 | func (this *HTTPRequest) Allow() { |
no test coverage detected