From df49dff4c6f96d1c2e032cc93e7b6bdb57f11833 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 1 Apr 2016 15:55:27 +0200 Subject: some cleanups diff --git a/src/rhctl/audio_switch_command.go b/src/rhctl/audio_switch_command.go index df357a6..d3aef7e 100644 --- a/src/rhctl/audio_switch_command.go +++ b/src/rhctl/audio_switch_command.go @@ -206,14 +206,15 @@ func SwitchCommandParseAudio(args []string) (cmdstr SwitchCmdString, cmdargs []i return } - var onum SwitchOutputNum + onum := SwitchOutputNum(0) if args[0] != "all" { if err = onum.FromString(args[0]); err != nil { return } cmdargs = append(cmdargs, onum) } - var inum SwitchInputNum + + inum := SwitchInputNum(0) if len(args) == 3 { if err = inum.FromString(args[2]); err != nil { return diff --git a/src/rhctl/main.go b/src/rhctl/main.go index 923a287..2d5b8c9 100644 --- a/src/rhctl/main.go +++ b/src/rhctl/main.go @@ -102,7 +102,7 @@ func main() { ctrl := SwitchControlInit(conf, sw, servers) - // running non-essential parts aka clients + // initializing non-essential parts aka clients telnet := TelnetInit(conf, ctrl) //************************************************** diff --git a/src/rhctl/playout_server.go b/src/rhctl/playout_server.go index 9f8b9d1..adba52d 100644 --- a/src/rhctl/playout_server.go +++ b/src/rhctl/playout_server.go @@ -82,8 +82,8 @@ func (srv *PlayoutServer) handleControl(data string) { func (srv *PlayoutServer) handleHeartbeat(data string) { rhdl.Printf("Server(%s): got heartbeat message: %q", srv.name, data) srv.hbtimer.Reset(srv.hbtimeout) - srv.hbcnt++ - if srv.hbcnt < srv.hbthreshold { + if (srv.hbcnt + 1) < srv.hbthreshold { + srv.hbcnt++ return } -- cgit v0.10.2