mirror of
https://github.com/caddyserver/caddy.git
synced 2026-01-17 01:30:34 +00:00
reverseproxy: make error chan bigger when reverse proxying websocket (#7419)
This commit is contained in:
@@ -214,7 +214,10 @@ func (h *Handler) handleUpgradeResponse(logger *zap.Logger, wg *sync.WaitGroup,
|
|||||||
timeoutc = timer.C
|
timeoutc = timer.C
|
||||||
}
|
}
|
||||||
|
|
||||||
errc := make(chan error, 1)
|
// when a stream timeout is encountered, no error will be read from errc
|
||||||
|
// a buffer size of 2 will allow both the read and write goroutines to send the error and exit
|
||||||
|
// see: https://github.com/caddyserver/caddy/issues/7418
|
||||||
|
errc := make(chan error, 2)
|
||||||
wg.Add(2)
|
wg.Add(2)
|
||||||
go spc.copyToBackend(errc)
|
go spc.copyToBackend(errc)
|
||||||
go spc.copyFromBackend(errc)
|
go spc.copyFromBackend(errc)
|
||||||
|
|||||||
Reference in New Issue
Block a user