Преглед на файлове

client: Timeout ident more nicely

tags/v0.1.0
Daniel Oaks преди 8 години
родител
ревизия
d810033a02
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. 4
    3
      irc/client.go

+ 4
- 3
irc/client.go Целия файл

@@ -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…
Отказ
Запис