Browse Source

Handle old-style MCU configuration with type but no url.

In the past this disabled the MCU but now was triggering an error due to an
invalid (empty) URL. Keep old behaviour and disable MCU again.
pull/55/head
Joachim Bauch 6 months ago
parent
commit
52e5978b19
Failed to extract signature
  1. 16
      src/server/main.go

16
src/server/main.go

@ -159,12 +159,16 @@ func main() {
if mcuType == "" && mcuUrl != "" {
log.Printf("WARNING: Old-style MCU configuration detected with url but no type, defaulting to type %s", signaling.McuTypeJanus)
mcuType = signaling.McuTypeJanus
} else if mcuType == signaling.McuTypeJanus && mcuUrl == "" {
log.Printf("WARNING: Old-style MCU configuration detected with type but no url, disabling")
mcuType = ""
}
if mcuType != "" {
var mcu signaling.Mcu
mcuRetry := initialMcuRetry
mcuRetryTimer := time.NewTimer(mcuRetry)
mcuTypeLoop:
for {
switch mcuType {
case signaling.McuTypeJanus:
@ -201,6 +205,10 @@ func main() {
if mcuType == "" && mcuUrl != "" {
log.Printf("WARNING: Old-style MCU configuration detected with url but no type, defaulting to type %s", signaling.McuTypeJanus)
mcuType = signaling.McuTypeJanus
} else if mcuType == signaling.McuTypeJanus && mcuUrl == "" {
log.Printf("WARNING: Old-style MCU configuration detected with type but no url, disabling")
mcuType = ""
break mcuTypeLoop
}
}
}
@ -212,10 +220,12 @@ func main() {
}
}
}
defer mcu.Stop()
if mcu != nil {
defer mcu.Stop()
log.Printf("Using %s MCU", mcuType)
hub.SetMcu(mcu)
log.Printf("Using %s MCU", mcuType)
hub.SetMcu(mcu)
}
}
go hub.Run()

Loading…
Cancel
Save