From c15c57f15f494ff629abbb93b8c5e88dfb905422 Mon Sep 17 00:00:00 2001 From: Alan Noble Date: Sun, 3 Mar 2019 07:04:33 +0000 Subject: [PATCH] Don't fail if Close() returns an error, since it just means there is no connection, and don't call Close when Dial fails. --- revid/senders.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/revid/senders.go b/revid/senders.go index 9d326471..2ac22f20 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -307,17 +307,13 @@ func (s *rtmpSender) release() { } func (s *rtmpSender) restart() error { - err := s.conn.Close() - if err != nil { - return err - } + s.conn.Close() for n := 0; n < s.retries; n++ { s.conn, err = rtmp.Dial(s.url, s.timeout, s.log) if err == nil { break } s.log(logger.Error, err.Error()) - s.conn.Close() if n < s.retries-1 { s.log(logger.Info, pkg+"retry rtmp connection") }