mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-22 00:21:30 +00:00
Support x/h2 v0.2.0 deadline
This commit is contained in:
parent
2c9d25e853
commit
ce1ddc400f
|
@ -153,13 +153,31 @@ func (c *GunConn) RemoteAddr() net.Addr {
|
|||
}
|
||||
|
||||
func (c *GunConn) SetDeadline(t time.Time) error {
|
||||
responseWriter, loaded := c.writer.(interface {
|
||||
SetWriteDeadline(time.Time) error
|
||||
})
|
||||
if !loaded {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
return responseWriter.SetWriteDeadline(t)
|
||||
}
|
||||
|
||||
func (c *GunConn) SetReadDeadline(t time.Time) error {
|
||||
responseWriter, loaded := c.writer.(interface {
|
||||
SetReadDeadline(time.Time) error
|
||||
})
|
||||
if !loaded {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
return responseWriter.SetReadDeadline(t)
|
||||
}
|
||||
|
||||
func (c *GunConn) SetWriteDeadline(t time.Time) error {
|
||||
responseWriter, loaded := c.writer.(interface {
|
||||
SetWriteDeadline(time.Time) error
|
||||
})
|
||||
if !loaded {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
return responseWriter.SetWriteDeadline(t)
|
||||
}
|
||||
|
|
|
@ -67,16 +67,34 @@ func (c *HTTPConn) RemoteAddr() net.Addr {
|
|||
}
|
||||
|
||||
func (c *HTTPConn) SetDeadline(t time.Time) error {
|
||||
responseWriter, loaded := c.writer.(interface {
|
||||
SetWriteDeadline(time.Time) error
|
||||
})
|
||||
if !loaded {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
return responseWriter.SetWriteDeadline(t)
|
||||
}
|
||||
|
||||
func (c *HTTPConn) SetReadDeadline(t time.Time) error {
|
||||
responseWriter, loaded := c.writer.(interface {
|
||||
SetReadDeadline(time.Time) error
|
||||
})
|
||||
if !loaded {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
return responseWriter.SetReadDeadline(t)
|
||||
}
|
||||
|
||||
func (c *HTTPConn) SetWriteDeadline(t time.Time) error {
|
||||
responseWriter, loaded := c.writer.(interface {
|
||||
SetWriteDeadline(time.Time) error
|
||||
})
|
||||
if !loaded {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
return responseWriter.SetWriteDeadline(t)
|
||||
}
|
||||
|
||||
type ServerHTTPConn struct {
|
||||
HTTPConn
|
||||
|
|
Loading…
Reference in a new issue