X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/d61414673846dc2bdafd0f1cc941caefb3cd5066..291a5280359f199d14007730b34b30b29ce8d018:/hotline/server.go?ds=sidebyside diff --git a/hotline/server.go b/hotline/server.go index 4b36cf6..bfc1c11 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -27,8 +27,6 @@ var contextKeyReq = contextKey("req") type requestCtx struct { remoteAddr string - login string - name string } type Server struct { @@ -105,7 +103,6 @@ func (s *Server) ListenAndServe(ctx context.Context, cancelRoot context.CancelFu ln, err := net.Listen("tcp", fmt.Sprintf("%s:%v", "", s.Port+1)) if err != nil { s.Logger.Fatal(err) - } s.Logger.Fatal(s.ServeFileTransfers(ctx, ln)) @@ -314,7 +311,7 @@ func (s *Server) keepaliveHandler() { c.Idle = true flagBitmap := big.NewInt(int64(binary.BigEndian.Uint16(c.Flags))) - flagBitmap.SetBit(flagBitmap, userFlagAway, 1) + flagBitmap.SetBit(flagBitmap, UserFlagAway, 1) binary.BigEndian.PutUint16(c.Flags, uint16(flagBitmap.Int64())) c.sendAll( @@ -740,7 +737,7 @@ func (s *Server) NewPrivateChat(cc *ClientConn) []byte { randID := make([]byte, 4) rand.Read(randID) - data := binary.BigEndian.Uint32(randID[:]) + data := binary.BigEndian.Uint32(randID) s.PrivateChats[data] = &PrivateChat{ ClientConn: make(map[uint16]*ClientConn),