From 8b65579719da12835736a9409a333dbfe38d7eae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 11 Jan 2026 01:16:57 +0000 Subject: [PATCH] Remove redundant nil check per code review Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com> --- proxy/vless/outbound/outbound.go | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/proxy/vless/outbound/outbound.go b/proxy/vless/outbound/outbound.go index f632ea54..2a5b1264 100644 --- a/proxy/vless/outbound/outbound.go +++ b/proxy/vless/outbound/outbound.go @@ -277,19 +277,17 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte rawInput = (*bytes.Buffer)(unsafe.Pointer(p + r.Offset)) // For pre-established connections, clear any buffered TLS control messages // to prevent them from corrupting the Vision stream - if conn != nil { - // Drain input buffer (decrypted but unread application data) - if input != nil && input.Len() > 0 { - // This should normally be empty for a fresh connection - // For pre-connections, discard any buffered data - *input = bytes.Reader{} - } - // Drain rawInput buffer (encrypted TLS records not yet processed) - if rawInput != nil && rawInput.Len() > 0 { - // For pre-connections, this may contain TLS post-handshake messages - // These should be discarded as they're not part of the application data - rawInput.Reset() - } + // Drain input buffer (decrypted but unread application data) + if input != nil && input.Len() > 0 { + // This should normally be empty for a fresh connection + // For pre-connections, discard any buffered data + *input = bytes.Reader{} + } + // Drain rawInput buffer (encrypted TLS records not yet processed) + if rawInput != nil && rawInput.Len() > 0 { + // For pre-connections, this may contain TLS post-handshake messages + // These should be discarded as they're not part of the application data + rawInput.Reset() } default: panic("unknown VLESS request command")