|
|
|
@ -357,6 +357,12 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
@@ -357,6 +357,12 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
|
|
|
|
|
} |
|
|
|
|
pathName = pathName[1:] // strip leading slash
|
|
|
|
|
|
|
|
|
|
// in RTSP, the control path is inserted after the query.
|
|
|
|
|
// therefore, path and query can't be threated separately
|
|
|
|
|
if req.Url.RawQuery != "" { |
|
|
|
|
pathName += "?" + req.Url.RawQuery |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch req.Method { |
|
|
|
|
case gortsplib.OPTIONS: |
|
|
|
|
c.conn.WriteResponse(&gortsplib.Response{ |
|
|
|
@ -382,6 +388,8 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
@@ -382,6 +388,8 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
|
|
|
|
|
return errRunTerminate |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pathName = removeQueryFromPath(pathName) |
|
|
|
|
|
|
|
|
|
confp := c.p.findConfForPathName(pathName) |
|
|
|
|
if confp == nil { |
|
|
|
|
c.writeResError(cseq, gortsplib.StatusBadRequest, |
|
|
|
@ -411,6 +419,8 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
@@ -411,6 +419,8 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
|
|
|
|
|
return errRunTerminate |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pathName = removeQueryFromPath(pathName) |
|
|
|
|
|
|
|
|
|
if len(pathName) == 0 { |
|
|
|
|
c.writeResError(cseq, gortsplib.StatusBadRequest, fmt.Errorf("empty base path")) |
|
|
|
|
return errRunTerminate |
|
|
|
@ -495,6 +505,8 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
@@ -495,6 +505,8 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
|
|
|
|
|
return errRunTerminate |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
basePath = removeQueryFromPath(basePath) |
|
|
|
|
|
|
|
|
|
switch c.state { |
|
|
|
|
// play
|
|
|
|
|
case clientStateInitial, clientStatePrePlay: |
|
|
|
@ -752,6 +764,8 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
@@ -752,6 +764,8 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
|
|
|
|
|
return errRunTerminate |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pathName = removeQueryFromPath(pathName) |
|
|
|
|
|
|
|
|
|
// path can end with a slash, remove it
|
|
|
|
|
pathName = strings.TrimSuffix(pathName, "/") |
|
|
|
|
|
|
|
|
@ -785,6 +799,8 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
@@ -785,6 +799,8 @@ func (c *client) handleRequest(req *gortsplib.Request) error {
|
|
|
|
|
return errRunTerminate |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
pathName = removeQueryFromPath(pathName) |
|
|
|
|
|
|
|
|
|
// path can end with a slash, remove it
|
|
|
|
|
pathName = strings.TrimSuffix(pathName, "/") |
|
|
|
|
|
|
|
|
|