From 459504300cfd02ebf0b52ee9a44d762910a6024b Mon Sep 17 00:00:00 2001 From: AsenHu <78863300+AsenHu@users.noreply.github.com> Date: Tue, 4 Jun 2024 00:13:46 +0800 Subject: [PATCH] chore: Remove unnecessary `if` in httpupgrade (#3413) --- transport/internet/httpupgrade/hub.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/transport/internet/httpupgrade/hub.go b/transport/internet/httpupgrade/hub.go index f78f8442..816730bc 100644 --- a/transport/internet/httpupgrade/hub.go +++ b/transport/internet/httpupgrade/hub.go @@ -78,12 +78,8 @@ func (s *server) Handle(conn net.Conn) (stat.Connection, error) { Port: int(0), } } - if remoteAddr == nil { - return nil, newError("remoteAddr is nil") - } - conn = newConnection(conn, remoteAddr) - return stat.Connection(conn), nil + return stat.Connection(newConnection(conn, remoteAddr)), nil } func (s *server) keepAccepting() {