mirror of
https://github.com/ergochat/ergo.git
synced 2025-01-03 16:42:38 +01:00
client: Timeout ident more nicely
This commit is contained in:
parent
199f8bd8ae
commit
d810033a02
@ -17,8 +17,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
IDLE_TIMEOUT = time.Minute + time.Second*30 // how long before a client is considered idle
|
IDLE_TIMEOUT = time.Minute + time.Second*30 // how long before a client is considered idle
|
||||||
QUIT_TIMEOUT = time.Minute // how long after idle before a client is kicked
|
QUIT_TIMEOUT = time.Minute // how long after idle before a client is kicked
|
||||||
|
IdentTimeoutSeconds = 8
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -82,7 +83,7 @@ func NewClient(server *Server, conn net.Conn, isTLS bool) *Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
client.Notice("*** Looking up your username")
|
client.Notice("*** Looking up your username")
|
||||||
resp, err := ident.Query(clientHost, serverPort, clientPort)
|
resp, err := ident.Query(clientHost, serverPort, clientPort, IdentTimeoutSeconds)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
username := resp.Identifier
|
username := resp.Identifier
|
||||||
//TODO(dan): replace this with IsUsername/IsIRCName?
|
//TODO(dan): replace this with IsUsername/IsIRCName?
|
||||||
|
Loading…
Reference in New Issue
Block a user