From 101dc6b0d91a219f5bf921d443fd37ad031c08b5 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 22 Mar 2020 09:45:33 -0400 Subject: [PATCH 1/3] increase TLS handshake timeout --- irc/socket.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/irc/socket.go b/irc/socket.go index e7c8887d..592a7190 100644 --- a/irc/socket.go +++ b/irc/socket.go @@ -20,8 +20,8 @@ import ( ) var ( - handshakeTimeout, _ = time.ParseDuration("5s") - errSendQExceeded = errors.New("SendQ exceeded") + handshakeTimeout = RegisterTimeout + errSendQExceeded = errors.New("SendQ exceeded") sendQExceededMessage = []byte("\r\nERROR :SendQ Exceeded\r\n") ) From f3d64d28596d30c7dd346be2720ae3bb5cf35d66 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 22 Mar 2020 09:51:36 -0400 Subject: [PATCH 2/3] move idletimer and fakelag initialization before certfp read --- irc/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/irc/client.go b/irc/client.go index 999343a2..72ba9436 100644 --- a/irc/client.go +++ b/irc/client.go @@ -278,6 +278,9 @@ func (server *Server) RunClient(conn clientConn, proxyLine string) { } client.sessions = []*Session{session} + session.idletimer.Initialize(session) + session.resetFakelag() + if conn.Config.TLSConfig != nil { client.SetMode(modes.TLS, true) // 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) { client.destroy(session) }() - session.idletimer.Initialize(session) - session.resetFakelag() - isReattach := client.Registered() if isReattach { if session.resumeDetails != nil { From 761d215ecde884fa4e846a84a7db015302bb6d05 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 22 Mar 2020 10:08:53 -0400 Subject: [PATCH 3/3] remove unnecessary comment --- irc/client.go | 1 - 1 file changed, 1 deletion(-) diff --git a/irc/client.go b/irc/client.go index 72ba9436..7e2508d8 100644 --- a/irc/client.go +++ b/irc/client.go @@ -1245,7 +1245,6 @@ func (client *Client) destroy(session *Session) { client.server.stats.Remove(registered, invisible, operator) } - // do not destroy the client if it has either remaining sessions, or is BRB'ed if !shouldDestroy { return }