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
 )
17
 )
18
 
18
 
19
 const (
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
 var (
25
 var (
82
 		}
83
 		}
83
 
84
 
84
 		client.Notice("*** Looking up your username")
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
 		if err == nil {
87
 		if err == nil {
87
 			username := resp.Identifier
88
 			username := resp.Identifier
88
 			//TODO(dan): replace this with IsUsername/IsIRCName?
89
 			//TODO(dan): replace this with IsUsername/IsIRCName?

Loading…
Cancel
Save