mirror of https://bitbucket.org/ausocean/av.git
revid: fixed mtsSender's output routine's logic
This commit is contained in:
parent
3841b8cb5b
commit
9a52f19e3d
|
@ -183,7 +183,6 @@ func newMtsSender(dst io.WriteCloser, log func(lvl int8, msg string, args ...int
|
|||
// output starts an mtsSender's data handling routine.
|
||||
func (s *mtsSender) output() {
|
||||
var chunk *ring.Chunk
|
||||
loop:
|
||||
for {
|
||||
select {
|
||||
case <-s.quit:
|
||||
|
@ -197,6 +196,7 @@ loop:
|
|||
chunk, err = s.ringBuf.Next(readTimeout)
|
||||
switch err {
|
||||
case nil:
|
||||
continue
|
||||
case ring.ErrTimeout:
|
||||
s.log(logger.Debug, pkg+"mtsSender: ring buffer read timeout")
|
||||
continue
|
||||
|
@ -204,10 +204,9 @@ loop:
|
|||
s.log(logger.Error, pkg+"mtsSender: unexpected error", "error", err.Error())
|
||||
fallthrough
|
||||
case io.EOF:
|
||||
goto loop
|
||||
continue
|
||||
}
|
||||
}
|
||||
// If chunk is not nil, then we need to try sending it off.
|
||||
} else {
|
||||
err := s.repairer.Repair(chunk.Bytes())
|
||||
if err != nil {
|
||||
chunk.Close()
|
||||
|
@ -224,7 +223,6 @@ loop:
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Write implements io.Writer.
|
||||
func (s *mtsSender) Write(d []byte) (int, error) {
|
||||
|
|
Loading…
Reference in New Issue