mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-27 04:07:28 +00:00
reverseproxy: drop nil-logger guard in runWebTransportPump
Production and test callers both pass a non-nil *zap.Logger. The defensive nil check silently swapped in a no-op logger, which can mask a real bug at the call site. Document the precondition in the doc comment instead, per review.
This commit is contained in:
parent
0ccf820f87
commit
594797cd3a
1 changed files with 1 additions and 3 deletions
|
|
@ -28,6 +28,7 @@ import (
|
|||
// runWebTransportPump bridges two WebTransport sessions so that every
|
||||
// bidirectional stream, unidirectional stream, and datagram opened on one
|
||||
// side is mirrored onto the other. It blocks until both sessions end.
|
||||
// logger must be non-nil; callers pass either h.logger or zap.NewNop().
|
||||
//
|
||||
// Close propagation: when either session ends with a SessionError, the
|
||||
// error code and message are forwarded to the peer via CloseWithError.
|
||||
|
|
@ -38,9 +39,6 @@ import (
|
|||
// EXPERIMENTAL: this helper is an internal building block for the
|
||||
// WebTransport reverse-proxy transport and may change.
|
||||
func runWebTransportPump(clientSess, upstreamSess *webtransport.Session, logger *zap.Logger) {
|
||||
if logger == nil {
|
||||
logger = zap.NewNop()
|
||||
}
|
||||
p := &webtransportPump{
|
||||
client: clientSess,
|
||||
upstream: upstreamSess,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue