|
|
|
@ -5,7 +5,6 @@ import (
@@ -5,7 +5,6 @@ import (
|
|
|
|
|
"io" |
|
|
|
|
"log" |
|
|
|
|
"net" |
|
|
|
|
"net/url" |
|
|
|
|
"os/exec" |
|
|
|
|
"strconv" |
|
|
|
|
"strings" |
|
|
|
@ -236,14 +235,8 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
@@ -236,14 +235,8 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
|
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ur, err := url.Parse(req.Url) |
|
|
|
|
if err != nil { |
|
|
|
|
c.writeResError(req, gortsplib.StatusBadRequest, fmt.Errorf("unable to parse path '%s'", req.Url)) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
path := func() string { |
|
|
|
|
ret := ur.Path |
|
|
|
|
ret := req.Url.Path |
|
|
|
|
|
|
|
|
|
// remove leading slash
|
|
|
|
|
if len(ret) > 1 { |
|
|
|
@ -306,7 +299,7 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
@@ -306,7 +299,7 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
|
|
|
|
|
StatusCode: gortsplib.StatusOK, |
|
|
|
|
Header: gortsplib.Header{ |
|
|
|
|
"CSeq": []string{cseq[0]}, |
|
|
|
|
"Content-Base": []string{req.Url}, |
|
|
|
|
"Content-Base": []string{req.Url.String()}, |
|
|
|
|
"Content-Type": []string{"application/sdp"}, |
|
|
|
|
}, |
|
|
|
|
Content: sdp, |
|
|
|
@ -441,7 +434,7 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
@@ -441,7 +434,7 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
|
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err = func() error { |
|
|
|
|
err := func() error { |
|
|
|
|
c.p.mutex.Lock() |
|
|
|
|
defer c.p.mutex.Unlock() |
|
|
|
|
|
|
|
|
@ -500,7 +493,7 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
@@ -500,7 +493,7 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
|
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err = func() error { |
|
|
|
|
err := func() error { |
|
|
|
|
c.p.mutex.Lock() |
|
|
|
|
defer c.p.mutex.Unlock() |
|
|
|
|
|
|
|
|
@ -588,7 +581,7 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
@@ -588,7 +581,7 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
|
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
err = func() error { |
|
|
|
|
err := func() error { |
|
|
|
|
c.p.mutex.Lock() |
|
|
|
|
defer c.p.mutex.Unlock() |
|
|
|
|
|
|
|
|
@ -637,7 +630,7 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
@@ -637,7 +630,7 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var interleaved string |
|
|
|
|
err = func() error { |
|
|
|
|
err := func() error { |
|
|
|
|
c.p.mutex.Lock() |
|
|
|
|
defer c.p.mutex.Unlock() |
|
|
|
|
|
|
|
|
|