Skip to content

Commit

Permalink
Mark session as used when connection is closed to prevent from timing…
Browse files Browse the repository at this point in the history
… out too early.
  • Loading branch information
fancycode committed Sep 16, 2020
1 parent 80194c4 commit d437dbb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/proxy/proxy_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,12 @@ func (s *ProxyServer) proxyHandler(w http.ResponseWriter, r *http.Request) {
return
}

client.OnClosed = s.clientClosed
client.OnClosed = func(c *signaling.Client) {
if session := client.GetSession(); session != nil {
session.MarkUsed()
}
s.clientClosed(c)
}
client.OnMessageReceived = func(c *signaling.Client, data []byte) {
s.processMessage(client, data)
}
Expand Down

0 comments on commit d437dbb

Please sign in to comment.