mirror of
https://github.com/strukturag/nextcloud-spreed-signaling.git
synced 2023-10-21 07:33:40 -05:00
Support defining maximum bandwidths at diferent levels.
- Individually for each backend. - For the proxy client (i.e. signaling server using cluster of proxies). - For the proxy server / MCU. The smallest bandwidth configured will be used, e.g. if a backend has a larger limit than the MCU assigned for the stream, the limit of the MCU server will be used.
This commit is contained in:
@@ -41,6 +41,9 @@ type Backend struct {
|
||||
secret []byte
|
||||
compat bool
|
||||
|
||||
maxStreamBitrate int
|
||||
maxScreenBitrate int
|
||||
|
||||
sessionLimit uint64
|
||||
sessionsLock sync.Mutex
|
||||
sessions map[string]bool
|
||||
@@ -269,11 +272,23 @@ func getConfiguredHosts(backendIds string, config *goconf.ConfigFile) (hosts map
|
||||
log.Printf("Backend %s allows a maximum of %d sessions", id, sessionLimit)
|
||||
}
|
||||
|
||||
maxStreamBitrate, err := config.GetInt(id, "maxstreambitrate")
|
||||
if err != nil || maxStreamBitrate < 0 {
|
||||
maxStreamBitrate = 0
|
||||
}
|
||||
maxScreenBitrate, err := config.GetInt(id, "maxscreenbitrate")
|
||||
if err != nil || maxScreenBitrate < 0 {
|
||||
maxScreenBitrate = 0
|
||||
}
|
||||
|
||||
hosts[parsed.Host] = append(hosts[parsed.Host], &Backend{
|
||||
id: id,
|
||||
url: u,
|
||||
secret: []byte(secret),
|
||||
|
||||
maxStreamBitrate: maxStreamBitrate,
|
||||
maxScreenBitrate: maxScreenBitrate,
|
||||
|
||||
sessionLimit: uint64(sessionLimit),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user