mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-14 10:45:08 +00:00
fix panic that happens when publishing to a path with source = redirect (#933)
This commit is contained in:
parent
1ad0df128d
commit
98b3538289
@ -762,13 +762,15 @@ func (pa *path) handlePublisherRemove(req pathPublisherRemoveReq) {
|
||||
|
||||
func (pa *path) handlePublisherAnnounce(req pathPublisherAnnounceReq) {
|
||||
if pa.source != nil {
|
||||
if pa.hasStaticSource() {
|
||||
req.res <- pathPublisherAnnounceRes{err: fmt.Errorf("path '%s' is assigned to a static source", pa.name)}
|
||||
if pa.conf.Source != "publisher" {
|
||||
req.res <- pathPublisherAnnounceRes{
|
||||
err: fmt.Errorf("can't publish to path '%s' since 'source' is not 'publisher'", pa.name),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if pa.conf.DisablePublisherOverride {
|
||||
req.res <- pathPublisherAnnounceRes{err: fmt.Errorf("another publisher is already publishing to path '%s'", pa.name)}
|
||||
req.res <- pathPublisherAnnounceRes{err: fmt.Errorf("someone is already publishing to path '%s'", pa.name)}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user