replace xnet.Transport by xnet.Pipe
This commit is contained in:
@@ -427,7 +427,8 @@ func (h *httpHandler) handleRequest(ctx context.Context, conn net.Conn, req *htt
|
||||
|
||||
start := time.Now()
|
||||
log.Infof("%s <-> %s", conn.RemoteAddr(), addr)
|
||||
xnet.Transport(conn, cc)
|
||||
// xnet.Transport(conn, cc)
|
||||
xnet.Pipe(ctx, conn, cc)
|
||||
log.WithFields(map[string]any{
|
||||
"duration": time.Since(start),
|
||||
}).Infof("%s >-< %s", conn.RemoteAddr(), addr)
|
||||
@@ -703,7 +704,8 @@ func (h *httpHandler) handleUpgradeResponse(ctx context.Context, rw io.ReadWrite
|
||||
return h.sniffingWebsocketFrame(ctx, rw, backConn, ro, log)
|
||||
}
|
||||
|
||||
return xnet.Transport(rw, backConn)
|
||||
// return xnet.Transport(rw, backConn)
|
||||
return xnet.Pipe(ctx, rw, backConn)
|
||||
}
|
||||
|
||||
func (h *httpHandler) sniffingWebsocketFrame(ctx context.Context, rw, cc io.ReadWriter, ro *xrecorder.HandlerRecorderObject, log logger.Logger) error {
|
||||
@@ -901,7 +903,8 @@ func (h *httpHandler) authenticate(ctx context.Context, conn net.Conn, req *http
|
||||
defer cc.Close()
|
||||
|
||||
req.Write(cc)
|
||||
xnet.Transport(conn, cc)
|
||||
// xnet.Transport(conn, cc)
|
||||
xnet.Pipe(ctx, conn, cc)
|
||||
return
|
||||
case "file":
|
||||
f, _ := os.Open(pr.Value)
|
||||
|
||||
Reference in New Issue
Block a user