mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-15 21:20:40 +08:00
feat: remove puller bad pull
This commit is contained in:
19
puller.go
19
puller.go
@@ -1,7 +1,6 @@
|
||||
package engine
|
||||
|
||||
import (
|
||||
"io"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -40,7 +39,7 @@ func (pub *Puller) Reconnect() (ok bool) {
|
||||
}
|
||||
|
||||
func (pub *Puller) startPull(puller IPuller) {
|
||||
badPuller := true
|
||||
// badPuller := true
|
||||
var stream *Stream
|
||||
var err error
|
||||
streamPath := pub.StreamPath
|
||||
@@ -75,14 +74,14 @@ func (pub *Puller) startPull(puller IPuller) {
|
||||
}
|
||||
startTime = time.Now()
|
||||
if err = puller.Connect(); err != nil {
|
||||
if err == io.EOF {
|
||||
puller.Info("pull complete")
|
||||
return
|
||||
}
|
||||
// if err == io.EOF {
|
||||
// puller.Info("pull complete")
|
||||
// return
|
||||
// }
|
||||
puller.Error("pull connect", zap.Error(err))
|
||||
if badPuller {
|
||||
return
|
||||
}
|
||||
// if badPuller {
|
||||
// return
|
||||
// }
|
||||
} else {
|
||||
if err = puller.Publish(pub.StreamPath, puller); err != nil {
|
||||
puller.Error("pull publish", zap.Error(err))
|
||||
@@ -94,7 +93,7 @@ func (pub *Puller) startPull(puller IPuller) {
|
||||
puber.VideoTrack = nil
|
||||
}
|
||||
stream = puber.Stream
|
||||
badPuller = false
|
||||
// badPuller = false
|
||||
if err = puller.Pull(); err != nil && !puller.IsShutdown() {
|
||||
puller.Error("pull interrupt", zap.Error(err))
|
||||
}
|
||||
|
Reference in New Issue
Block a user