support zero spaces between header keys and values, support transport headers with implicit unicast; fix #9

This commit is contained in:
aler9 2020-06-14 17:46:27 +02:00
parent a05ee4990a
commit a535dab477
5 changed files with 10 additions and 12 deletions

View File

@ -67,9 +67,7 @@ export DOCKERFILE_RUN
run:
echo "$$DOCKERFILE_RUN" | docker build -q . -f - -t temp
docker run --rm -it \
-p 8554:8554 \
-p 8000:8000/udp \
-p 8001:8001/udp \
--network=host \
temp \
/out $(ARGS)

View File

@ -106,6 +106,7 @@ Related projects
* https://github.com/aler9/gortsplib
* https://github.com/flaviostutz/rtsp-relay
IETF Standard
* (1.0) https://tools.ietf.org/html/rfc2326
* (2.0) https://tools.ietf.org/html/rfc7826
IETF Standards
* RTSP 1.0 https://tools.ietf.org/html/rfc2326
* RTSP 2.0 https://tools.ietf.org/html/rfc7826
* HTTP 1.1 https://tools.ietf.org/html/rfc2616

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.13
require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/aler9/gortsplib v0.0.0-20200517144705-37bd9a1b98ce
github.com/aler9/gortsplib v0.0.0-20200614152940-c06d302979f1
github.com/stretchr/testify v1.4.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gortc.io/sdp v0.18.2

4
go.sum
View File

@ -2,8 +2,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafo
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/aler9/gortsplib v0.0.0-20200517144705-37bd9a1b98ce h1:YBes3GDLTF/UonS+v9s478lfCqg6HGRAaaiR9iMtygc=
github.com/aler9/gortsplib v0.0.0-20200517144705-37bd9a1b98ce/go.mod h1:sL64nUkmrTVhlT/GCaxRXyI2Xk7m8XSdw5Uv8xKGPdc=
github.com/aler9/gortsplib v0.0.0-20200614152940-c06d302979f1 h1:x0CLAhwm0sCZktOzVOaEB26Lj+mJTgCwsjAJkFYKPUI=
github.com/aler9/gortsplib v0.0.0-20200614152940-c06d302979f1/go.mod h1:sL64nUkmrTVhlT/GCaxRXyI2Xk7m8XSdw5Uv8xKGPdc=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

View File

@ -397,9 +397,8 @@ func (c *serverClient) handleRequest(req *gortsplib.Request) bool {
}
th := gortsplib.ReadHeaderTransport(tsRaw[0])
if _, ok := th["unicast"]; !ok {
c.writeResError(req, gortsplib.StatusBadRequest, fmt.Errorf("transport header does not contain unicast"))
if _, ok := th["multicast"]; ok {
c.writeResError(req, gortsplib.StatusBadRequest, fmt.Errorf("multicast is not supported"))
return false
}