mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-29 18:28:10 -07:00
add a login timout to close dropped connections
This commit is contained in:
+6
-2
@@ -5,13 +5,17 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func AddrLookupHostname(addr net.Addr) string {
|
||||
func IPString(addr net.Addr) string {
|
||||
addrStr := addr.String()
|
||||
ipaddr, _, err := net.SplitHostPort(addrStr)
|
||||
if err != nil {
|
||||
return addrStr
|
||||
}
|
||||
return LookupHostname(ipaddr)
|
||||
return ipaddr
|
||||
}
|
||||
|
||||
func AddrLookupHostname(addr net.Addr) string {
|
||||
return LookupHostname(IPString(addr))
|
||||
}
|
||||
|
||||
func LookupHostname(addr string) string {
|
||||
|
||||
Reference in New Issue
Block a user