Skip to content

Commit

Permalink
fix flv parser timeout bug (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
kira1928 authored Jan 25, 2023
1 parent 0a93c77 commit 8c98b8c
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/pkg/parser/native/flv/flv.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"net/url"
"os"
"sync"
"time"

"github.com/hr3lxphr6j/bililive-go/src/live"
"github.com/hr3lxphr6j/bililive-go/src/pkg/parser"
Expand Down Expand Up @@ -38,15 +37,13 @@ func init() {
type builder struct{}

func (b *builder) Build(cfg map[string]string) (parser.Parser, error) {
timeout, err := time.ParseDuration(cfg["timeout_in_us"] + "us")
if err != nil {
timeout = time.Minute
}
// timeout, err := time.ParseDuration(cfg["timeout_in_us"] + "us")
// if err != nil {
// timeout = time.Minute
// }
return &Parser{
Metadata: Metadata{},
hc: &http.Client{
Timeout: timeout,
},
Metadata: Metadata{},
hc: &http.Client{},
stopCh: make(chan struct{}),
closeOnce: new(sync.Once),
}, nil
Expand Down

0 comments on commit 8c98b8c

Please sign in to comment.