chore: Remove unnecessary `if` in httpupgrade (#3413)

This commit is contained in:
AsenHu 2024-06-04 00:13:46 +08:00 committed by GitHub
parent 075051a693
commit 459504300c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,12 +78,8 @@ func (s *server) Handle(conn net.Conn) (stat.Connection, error) {
Port: int(0), Port: int(0),
} }
} }
if remoteAddr == nil {
return nil, newError("remoteAddr is nil")
}
conn = newConnection(conn, remoteAddr) return stat.Connection(newConnection(conn, remoteAddr)), nil
return stat.Connection(conn), nil
} }
func (s *server) keepAccepting() { func (s *server) keepAccepting() {