Improve multiplex

This commit is contained in:
世界
2023-04-20 11:16:22 +08:00
parent daee0db7bb
commit bc32c78d03
18 changed files with 155 additions and 1200 deletions

View File

@@ -199,13 +199,13 @@ func (c *HTTP2Conn) NeedAdditionalReadDeadline() bool {
type ServerHTTPConn struct {
HTTP2Conn
flusher http.Flusher
Flusher http.Flusher
}
func (c *ServerHTTPConn) Write(b []byte) (n int, err error) {
n, err = c.writer.Write(b)
if err == nil {
c.flusher.Flush()
c.Flusher.Flush()
}
return
}
@@ -246,6 +246,11 @@ func (w *HTTP2ConnWrapper) CloseWrapper() {
w.closed = true
}
func (w *HTTP2ConnWrapper) Close() error {
w.CloseWrapper()
return w.ExtendedConn.Close()
}
func (w *HTTP2ConnWrapper) Upstream() any {
return w.ExtendedConn
}