Add timeout value to RTSP SETUP response #289

This commit is contained in:
Alexey Khit
2023-04-17 15:12:03 +03:00
parent edb4e6eaad
commit 6cef5faf27
+7 -3
View File
@@ -72,9 +72,9 @@ func (s State) String() string {
return "CONN" return "CONN"
case StateSetup: case StateSetup:
return "SETUP" return MethodSetup
case StatePlay: case StatePlay:
return "PLAY" return MethodPlay
} }
return strconv.Itoa(int(s)) return strconv.Itoa(int(s))
} }
@@ -312,7 +312,11 @@ func (c *Conn) WriteResponse(res *tcp.Response) error {
} }
if c.session != "" { if c.session != "" {
res.Header.Set("Session", c.session) if res.Request != nil && res.Request.Method == MethodSetup {
res.Header.Set("Session", c.session+";timeout=60")
} else {
res.Header.Set("Session", c.session)
}
} }
if res.Body != nil { if res.Body != nil {