diff --git a/revid/senders.go b/revid/senders.go index d37e0e4c..6e59a856 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -29,8 +29,6 @@ LICENSE package revid import ( - "bytes" - "fmt" "io" "os" "os/exec" @@ -107,8 +105,6 @@ type httpSender struct { log func(lvl, msg string) - buf []byte - chunk *ring.Chunk } @@ -123,25 +119,16 @@ func newHttpSender(_ string, _ time.Duration, log func(lvl, msg string)) *httpSe func (s *httpSender) load(c *ring.Chunk) error { s.chunk = c - buf := bytes.NewBuffer(s.buf[:0]) - _, err := s.chunk.WriteTo(buf) - s.buf = buf.Bytes() - if err != nil { - return fmt.Errorf("httpSender: %v", err) - } return nil } func (s *httpSender) send() error { pins := netsender.MakePins("V0", "") - pins[0].Value = len(s.buf) - pins[0].Data = s.buf + pins[0].Value = s.chunk.Len() + pins[0].Data = s.chunk.Bytes() pins[0].MimeType = "video/mp2t" _, _, err := s.client.Send(netsender.RequestPoll, pins) - if err != nil { - return err - } - return nil + return err } func (s *httpSender) release() {