Skip to content

Commit 83c0185

Browse files
myleshortonclaude
andcommitted
Fix nil pointer in algeneva NewConnectionEx error path
The conn variable was shadowed by the return from newConnectionEx, causing CloseOnHandshakeFailure to receive nil when the handshake fails (e.g., port readiness check sends empty data). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 56f1f1c commit 83c0185

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

protocol/algeneva/inbound.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ func (a *Inbound) Close() error {
6969
func (a *Inbound) NewConnectionEx(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc) {
7070
metadata.Inbound = a.Tag()
7171
metadata.InboundType = a.Type()
72-
conn, err := a.newConnectionEx(ctx, conn)
72+
wsConn, err := a.newConnectionEx(ctx, conn)
7373
if err != nil {
7474
N.CloseOnHandshakeFailure(conn, onClose, err)
7575
a.logger.ErrorContext(ctx, exceptions.Cause(err, "process connection from ", metadata.Source))
7676
return
7777
}
78-
a.httpInbound.NewConnectionEx(ctx, conn, metadata, onClose)
78+
a.httpInbound.NewConnectionEx(ctx, wsConn, metadata, onClose)
7979
}
8080

8181
// newConnectionEx processes the connection and upgrades it to a WebSocket connection.

0 commit comments

Comments
 (0)