mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-10 02:53:12 +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 {
|
||||
return os.ErrInvalid
|
||||
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 {
|
||||
return os.ErrInvalid
|
||||
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 {
|
||||
return os.ErrInvalid
|
||||
responseWriter, loaded := c.writer.(interface {
|
||||
SetWriteDeadline(time.Time) error
|
||||
})
|
||||
if !loaded {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
return responseWriter.SetWriteDeadline(t)
|
||||
}
|
||||
|
|
|
@ -67,15 +67,33 @@ func (c *HTTPConn) RemoteAddr() net.Addr {
|
|||
}
|
||||
|
||||
func (c *HTTPConn) SetDeadline(t time.Time) error {
|
||||
return os.ErrInvalid
|
||||
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 {
|
||||
return os.ErrInvalid
|
||||
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 {
|
||||
return os.ErrInvalid
|
||||
responseWriter, loaded := c.writer.(interface {
|
||||
SetWriteDeadline(time.Time) error
|
||||
})
|
||||
if !loaded {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
return responseWriter.SetWriteDeadline(t)
|
||||
}
|
||||
|
||||
type ServerHTTPConn struct {
|
||||
|
|
Loading…
Reference in a new issue