3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

Merge pull request #895 from slingamn/issue894_tlstimeout

fix #894
This commit is contained in:
Shivaram Lingamneni 2020-03-22 08:25:59 -07:00 committed by GitHub
commit 8153fb244e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -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 {
@ -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
}

View File

@ -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")
)