downstream: rejigger hostname logic in newDOwnstreamConn
I find it easier to read this way.
This commit is contained in:
parent
e403b88a3d
commit
069625d30d
@ -341,9 +341,10 @@ func newDownstreamConn(srv *Server, ic ircConn, id uint64) *downstreamConn {
|
|||||||
registration: new(downstreamRegistration),
|
registration: new(downstreamRegistration),
|
||||||
}
|
}
|
||||||
dc.monitored.SetCasemapping(casemapASCII)
|
dc.monitored.SetCasemapping(casemapASCII)
|
||||||
dc.hostname = remoteAddr
|
if host, _, err := net.SplitHostPort(remoteAddr); err == nil {
|
||||||
if host, _, err := net.SplitHostPort(dc.hostname); err == nil {
|
|
||||||
dc.hostname = host
|
dc.hostname = host
|
||||||
|
} else {
|
||||||
|
dc.hostname = remoteAddr
|
||||||
}
|
}
|
||||||
for k, v := range permanentDownstreamCaps {
|
for k, v := range permanentDownstreamCaps {
|
||||||
dc.caps.Available[k] = v
|
dc.caps.Available[k] = v
|
||||||
|
Loading…
Reference in New Issue
Block a user