Selaa lähdekoodia

Merge pull request #895 from slingamn/issue894_tlstimeout

fix #894
tags/v2.1.0-rc1
Shivaram Lingamneni 4 vuotta sitten
vanhempi
commit
8153fb244e
No account linked to committer's email address
2 muutettua tiedostoa jossa 5 lisäystä ja 6 poistoa
  1. 3
    4
      irc/client.go
  2. 2
    2
      irc/socket.go

+ 3
- 4
irc/client.go Näytä tiedosto

@@ -278,6 +278,9 @@ func (server *Server) RunClient(conn clientConn, proxyLine string) {
278 278
 	}
279 279
 	client.sessions = []*Session{session}
280 280
 
281
+	session.idletimer.Initialize(session)
282
+	session.resetFakelag()
283
+
281 284
 	if conn.Config.TLSConfig != nil {
282 285
 		client.SetMode(modes.TLS, true)
283 286
 		// error is not useful to us here anyways so we can ignore it
@@ -535,9 +538,6 @@ func (client *Client) run(session *Session, proxyLine string) {
535 538
 		client.destroy(session)
536 539
 	}()
537 540
 
538
-	session.idletimer.Initialize(session)
539
-	session.resetFakelag()
540
-
541 541
 	isReattach := client.Registered()
542 542
 	if isReattach {
543 543
 		if session.resumeDetails != nil {
@@ -1245,7 +1245,6 @@ func (client *Client) destroy(session *Session) {
1245 1245
 		client.server.stats.Remove(registered, invisible, operator)
1246 1246
 	}
1247 1247
 
1248
-	// do not destroy the client if it has either remaining sessions, or is BRB'ed
1249 1248
 	if !shouldDestroy {
1250 1249
 		return
1251 1250
 	}

+ 2
- 2
irc/socket.go Näytä tiedosto

@@ -20,8 +20,8 @@ import (
20 20
 )
21 21
 
22 22
 var (
23
-	handshakeTimeout, _ = time.ParseDuration("5s")
24
-	errSendQExceeded    = errors.New("SendQ exceeded")
23
+	handshakeTimeout = RegisterTimeout
24
+	errSendQExceeded = errors.New("SendQ exceeded")
25 25
 
26 26
 	sendQExceededMessage = []byte("\r\nERROR :SendQ Exceeded\r\n")
27 27
 )

Loading…
Peruuta
Tallenna