From 069625d30d9db9e5fcd0b3ad02482f50ed30277d Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 21 Mar 2022 16:33:58 +0100 Subject: [PATCH] downstream: rejigger hostname logic in newDOwnstreamConn I find it easier to read this way. --- downstream.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/downstream.go b/downstream.go index 72e24e1..888ee20 100644 --- a/downstream.go +++ b/downstream.go @@ -341,9 +341,10 @@ func newDownstreamConn(srv *Server, ic ircConn, id uint64) *downstreamConn { registration: new(downstreamRegistration), } dc.monitored.SetCasemapping(casemapASCII) - dc.hostname = remoteAddr - if host, _, err := net.SplitHostPort(dc.hostname); err == nil { + if host, _, err := net.SplitHostPort(remoteAddr); err == nil { dc.hostname = host + } else { + dc.hostname = remoteAddr } for k, v := range permanentDownstreamCaps { dc.caps.Available[k] = v