mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-06-13 15:47:38 +08:00
refactor: simplify reverse proxy bridged connection handling by removing unused bufio
This commit is contained in:
parent
a9c1662333
commit
50c6a23614
1 changed files with 0 additions and 6 deletions
|
|
@ -5,7 +5,6 @@
|
|||
package touka
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
|
|
@ -1011,7 +1010,6 @@ func (p *reverseProxyHandler) handleBridgedExtendedConnectResponse(c *Context, r
|
|||
}
|
||||
|
||||
conn := reverseProxyH2ReadWriteCloser{ReadCloser: bridge.body, ResponseWriter: c.Writer}
|
||||
brw := bufio.NewReadWriter(bufio.NewReaderSize(conn, 1), bufio.NewWriterSize(conn, 1))
|
||||
|
||||
backConnClosed := make(chan struct{})
|
||||
go func() {
|
||||
|
|
@ -1025,10 +1023,6 @@ func (p *reverseProxyHandler) handleBridgedExtendedConnectResponse(c *Context, r
|
|||
defer conn.Close()
|
||||
defer backConn.Close()
|
||||
|
||||
if err := brw.Flush(); err != nil {
|
||||
return &reverseProxyStatusError{status: http.StatusBadGateway, err: err}
|
||||
}
|
||||
|
||||
errc := make(chan error, 2)
|
||||
copyer := switchProtocolCopier{user: conn, backend: backConn}
|
||||
go copyer.copyToBackend(errc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue