Merge pull request #147 from Bruno-DaSilva/master

Add unlocks to error cases in handlers::handlePublish()
This commit is contained in:
Nick 2021-01-10 11:46:31 -05:00 committed by GitHub
commit b3b9255ea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -363,16 +363,19 @@ func handlePublish(conn *rtmp.Conn) {
if len(urlParts) > 2 {
common.LogErrorln("Extra garbage after stream key")
l.Unlock()
return
}
if len(urlParts) != 2 {
common.LogErrorln("Missing stream key")
l.Unlock()
return
}
if urlParts[1] != settings.GetStreamKey() {
common.LogErrorln("Stream key is incorrect. Denying stream.")
l.Unlock()
return //If key not match, deny stream
}