Browse Source

client: Timeout ident more nicely

tags/v0.1.0
Daniel Oaks 8 years ago
parent
commit
d810033a02
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      irc/client.go

+ 4
- 3
irc/client.go View File

@@ -17,8 +17,9 @@ import (
17 17
 )
18 18
 
19 19
 const (
20
-	IDLE_TIMEOUT = time.Minute + time.Second*30 // how long before a client is considered idle
21
-	QUIT_TIMEOUT = time.Minute                  // how long after idle before a client is kicked
20
+	IDLE_TIMEOUT        = time.Minute + time.Second*30 // how long before a client is considered idle
21
+	QUIT_TIMEOUT        = time.Minute                  // how long after idle before a client is kicked
22
+	IdentTimeoutSeconds = 8
22 23
 )
23 24
 
24 25
 var (
@@ -82,7 +83,7 @@ func NewClient(server *Server, conn net.Conn, isTLS bool) *Client {
82 83
 		}
83 84
 
84 85
 		client.Notice("*** Looking up your username")
85
-		resp, err := ident.Query(clientHost, serverPort, clientPort)
86
+		resp, err := ident.Query(clientHost, serverPort, clientPort, IdentTimeoutSeconds)
86 87
 		if err == nil {
87 88
 			username := resp.Identifier
88 89
 			//TODO(dan): replace this with IsUsername/IsIRCName?

Loading…
Cancel
Save