mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-12-24 13:48:04 +08:00
fix: rtmp timeout
This commit is contained in:
2
go.mod
2
go.mod
@@ -24,6 +24,7 @@ require (
|
||||
github.com/icholy/digest v1.1.0
|
||||
github.com/jinzhu/copier v0.4.0
|
||||
github.com/kerberos-io/onvif v1.0.0
|
||||
github.com/langhuihui/gotask v0.0.0-20250926063623-e8031a3bf4d2
|
||||
github.com/mark3labs/mcp-go v0.27.0
|
||||
github.com/mattn/go-sqlite3 v1.14.24
|
||||
github.com/mcuadros/go-defaults v1.2.0
|
||||
@@ -90,7 +91,6 @@ require (
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/juju/errors v1.0.0 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/langhuihui/gotask v0.0.0-20250926063623-e8031a3bf4d2 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/marcboeker/go-duckdb v1.0.5 // indirect
|
||||
|
||||
@@ -77,7 +77,7 @@ func NewNetConnection(conn net.Conn) (ret *NetConnection) {
|
||||
|
||||
func (nc *NetConnection) Init(conn net.Conn) {
|
||||
nc.Conn = conn
|
||||
nc.BufReader = util.NewBufReader(conn)
|
||||
nc.BufReader = util.NewBufReaderWithTimeout(conn, 10*time.Second)
|
||||
nc.bandwidth = RTMP_MAX_CHUNK_SIZE << 3
|
||||
nc.ReadChunkSize = RTMP_DEFAULT_CHUNK_SIZE
|
||||
nc.WriteChunkSize = RTMP_DEFAULT_CHUNK_SIZE
|
||||
@@ -131,7 +131,6 @@ func (nc *NetConnection) ResponseCreateStream(tid uint64, streamID uint32) error
|
||||
// }
|
||||
|
||||
func (nc *NetConnection) readChunk() (msg *Chunk, err error) {
|
||||
nc.SetReadDeadline(time.Now().Add(time.Second * 5)) // 设置读取超时时间为5秒
|
||||
head, err := nc.ReadByte()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user