mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-08 17:10:18 +08:00
api: fix crash when retrieving RTMP and SRT connections (#2430)
Co-authored-by: Paxx <daniel.botta@hiway.media>
This commit is contained in:
@@ -644,7 +644,7 @@ func (c *rtmpConn) apiItem() *apiRTMPConn {
|
|||||||
bytesReceived := uint64(0)
|
bytesReceived := uint64(0)
|
||||||
bytesSent := uint64(0)
|
bytesSent := uint64(0)
|
||||||
|
|
||||||
if c.conn != nil {
|
if c.rconn != nil {
|
||||||
bytesReceived = c.rconn.BytesReceived()
|
bytesReceived = c.rconn.BytesReceived()
|
||||||
bytesSent = c.rconn.BytesSent()
|
bytesSent = c.rconn.BytesSent()
|
||||||
}
|
}
|
||||||
|
@@ -697,7 +697,7 @@ func (c *srtConn) apiItem() *apiSRTConn {
|
|||||||
bytesReceived := uint64(0)
|
bytesReceived := uint64(0)
|
||||||
bytesSent := uint64(0)
|
bytesSent := uint64(0)
|
||||||
|
|
||||||
if c.conn != nil {
|
if c.sconn != nil {
|
||||||
var s srt.Statistics
|
var s srt.Statistics
|
||||||
c.sconn.Stats(&s)
|
c.sconn.Stats(&s)
|
||||||
bytesReceived = s.Accumulated.ByteRecv
|
bytesReceived = s.Accumulated.ByteRecv
|
||||||
|
Reference in New Issue
Block a user