aboutsummaryrefslogtreecommitdiff
path: root/hotline/server.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-05-27 10:44:52 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-05-27 10:44:52 -0700
commit61c272e101b6f0444c7b2a666b0b5e828ba6db03 (patch)
treec9bc0c571cbfb63c70b37eb5e39ae797714fc756 /hotline/server.go
parent6f0f1ef7c51f8d495a5818c4864650a7e1cfc8ef (diff)
Simplify user idle check
Diffstat (limited to 'hotline/server.go')
-rw-r--r--hotline/server.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/hotline/server.go b/hotline/server.go
index 61cd7fa..c5a29ba 100644
--- a/hotline/server.go
+++ b/hotline/server.go
@@ -278,8 +278,8 @@ func (s *Server) keepaliveHandler() {
s.mux.Lock()
for _, c := range s.Clients {
- *c.IdleTime += idleCheckInterval
- if *c.IdleTime > userIdleSeconds && !c.Idle {
+ c.IdleTime += idleCheckInterval
+ if c.IdleTime > userIdleSeconds && !c.Idle {
c.Idle = true
flagBitmap := big.NewInt(int64(binary.BigEndian.Uint16(*c.Flags)))
@@ -327,7 +327,6 @@ func (s *Server) NewClientConn(conn net.Conn) *ClientConn {
Connection: conn,
Server: s,
Version: &[]byte{},
- IdleTime: new(int),
AutoReply: &[]byte{},
Transfers: make(map[int][]*FileTransfer),
Agreed: false,
@@ -335,8 +334,6 @@ func (s *Server) NewClientConn(conn net.Conn) *ClientConn {
*s.NextGuestID++
ID := *s.NextGuestID
- *clientConn.IdleTime = 0
-
binary.BigEndian.PutUint16(*clientConn.ID, ID)
s.Clients[ID] = clientConn