Add timeout value to RTSP SETUP response #289
This commit is contained in:
+6
-2
@@ -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,8 +312,12 @@ func (c *Conn) WriteResponse(res *tcp.Response) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if c.session != "" {
|
if 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)
|
res.Header.Set("Session", c.session)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if res.Body != nil {
|
if res.Body != nil {
|
||||||
val := strconv.Itoa(len(res.Body))
|
val := strconv.Itoa(len(res.Body))
|
||||||
|
|||||||
Reference in New Issue
Block a user