mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-14 11:45:35 +02:00
Compare commits
4 commits
b89e017ae4
...
61000f5f69
Author | SHA1 | Date | |
---|---|---|---|
61000f5f69 | |||
865798f920 | |||
043691d703 | |||
82c20ba930 |
4
Makefile
4
Makefile
|
@ -46,7 +46,9 @@ endif
|
||||||
hook:
|
hook:
|
||||||
[ ! -d "$(CURDIR)/.git/hooks" ] || ln -sf "$(CURDIR)/scripts/pre-commit.hook" "$(CURDIR)/.git/hooks/pre-commit"
|
[ ! -d "$(CURDIR)/.git/hooks" ] || ln -sf "$(CURDIR)/scripts/pre-commit.hook" "$(CURDIR)/.git/hooks/pre-commit"
|
||||||
|
|
||||||
godeps:
|
godeps: $(VENDORBIN)/godeps
|
||||||
|
|
||||||
|
$(VENDORBIN)/godeps:
|
||||||
GOPATH=$(GOPATH) $(GO) get github.com/rogpeppe/godeps
|
GOPATH=$(GOPATH) $(GO) get github.com/rogpeppe/godeps
|
||||||
|
|
||||||
easyjson: dependencies
|
easyjson: dependencies
|
||||||
|
|
|
@ -81,6 +81,9 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
type ProxyServer struct {
|
type ProxyServer struct {
|
||||||
|
// 64-bit members that are accessed atomically must be 64-bit aligned.
|
||||||
|
load int64
|
||||||
|
|
||||||
version string
|
version string
|
||||||
country string
|
country string
|
||||||
|
|
||||||
|
@ -88,7 +91,6 @@ type ProxyServer struct {
|
||||||
nats signaling.NatsClient
|
nats signaling.NatsClient
|
||||||
mcu signaling.Mcu
|
mcu signaling.Mcu
|
||||||
stopped uint32
|
stopped uint32
|
||||||
load int64
|
|
||||||
|
|
||||||
shutdownChannel chan bool
|
shutdownChannel chan bool
|
||||||
shutdownScheduled uint32
|
shutdownScheduled uint32
|
||||||
|
|
|
@ -37,10 +37,12 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type ProxySession struct {
|
type ProxySession struct {
|
||||||
|
// 64-bit members that are accessed atomically must be 64-bit aligned.
|
||||||
|
lastUsed int64
|
||||||
|
|
||||||
proxy *ProxyServer
|
proxy *ProxyServer
|
||||||
id string
|
id string
|
||||||
sid uint64
|
sid uint64
|
||||||
lastUsed int64
|
|
||||||
|
|
||||||
clientLock sync.Mutex
|
clientLock sync.Mutex
|
||||||
client *ProxyClient
|
client *ProxyClient
|
||||||
|
|
|
@ -96,6 +96,9 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Hub struct {
|
type Hub struct {
|
||||||
|
// 64-bit members that are accessed atomically must be 64-bit aligned.
|
||||||
|
sid uint64
|
||||||
|
|
||||||
nats NatsClient
|
nats NatsClient
|
||||||
upgrader websocket.Upgrader
|
upgrader websocket.Upgrader
|
||||||
cookie *securecookie.SecureCookie
|
cookie *securecookie.SecureCookie
|
||||||
|
@ -113,7 +116,6 @@ type Hub struct {
|
||||||
mu sync.RWMutex
|
mu sync.RWMutex
|
||||||
ru sync.RWMutex
|
ru sync.RWMutex
|
||||||
|
|
||||||
sid uint64
|
|
||||||
clients map[uint64]*Client
|
clients map[uint64]*Client
|
||||||
sessions map[uint64]Session
|
sessions map[uint64]Session
|
||||||
rooms map[string]*Room
|
rooms map[string]*Room
|
||||||
|
|
|
@ -136,6 +136,9 @@ type clientInterface interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type mcuJanus struct {
|
type mcuJanus struct {
|
||||||
|
// 64-bit members that are accessed atomically must be 64-bit aligned.
|
||||||
|
clientId uint64
|
||||||
|
|
||||||
url string
|
url string
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
nats NatsClient
|
nats NatsClient
|
||||||
|
@ -150,7 +153,6 @@ type mcuJanus struct {
|
||||||
|
|
||||||
closeChan chan bool
|
closeChan chan bool
|
||||||
|
|
||||||
clientId uint64
|
|
||||||
muClients sync.Mutex
|
muClients sync.Mutex
|
||||||
clients map[clientInterface]bool
|
clients map[clientInterface]bool
|
||||||
|
|
||||||
|
|
|
@ -259,6 +259,11 @@ func (s *mcuProxySubscriber) ProcessEvent(msg *EventProxyServerMessage) {
|
||||||
}
|
}
|
||||||
|
|
||||||
type mcuProxyConnection struct {
|
type mcuProxyConnection struct {
|
||||||
|
// 64-bit members that are accessed atomically must be 64-bit aligned.
|
||||||
|
reconnectInterval int64
|
||||||
|
msgId int64
|
||||||
|
load int64
|
||||||
|
|
||||||
proxy *mcuProxy
|
proxy *mcuProxy
|
||||||
rawUrl string
|
rawUrl string
|
||||||
url *url.URL
|
url *url.URL
|
||||||
|
@ -270,15 +275,12 @@ type mcuProxyConnection struct {
|
||||||
conn *websocket.Conn
|
conn *websocket.Conn
|
||||||
|
|
||||||
connectedSince time.Time
|
connectedSince time.Time
|
||||||
reconnectInterval int64
|
|
||||||
reconnectTimer *time.Timer
|
reconnectTimer *time.Timer
|
||||||
shutdownScheduled uint32
|
shutdownScheduled uint32
|
||||||
closeScheduled uint32
|
closeScheduled uint32
|
||||||
|
|
||||||
msgId int64
|
|
||||||
helloMsgId string
|
helloMsgId string
|
||||||
sessionId string
|
sessionId string
|
||||||
load int64
|
|
||||||
country atomic.Value
|
country atomic.Value
|
||||||
|
|
||||||
callbacks map[string]func(*ProxyServerMessage)
|
callbacks map[string]func(*ProxyServerMessage)
|
||||||
|
@ -959,6 +961,10 @@ func (c *mcuProxyConnection) newSubscriber(ctx context.Context, listener McuList
|
||||||
}
|
}
|
||||||
|
|
||||||
type mcuProxy struct {
|
type mcuProxy struct {
|
||||||
|
// 64-bit members that are accessed atomically must be 64-bit aligned.
|
||||||
|
connRequests int64
|
||||||
|
nextSort int64
|
||||||
|
|
||||||
tokenId string
|
tokenId string
|
||||||
tokenKey *rsa.PrivateKey
|
tokenKey *rsa.PrivateKey
|
||||||
|
|
||||||
|
@ -972,8 +978,6 @@ type mcuProxy struct {
|
||||||
connections []*mcuProxyConnection
|
connections []*mcuProxyConnection
|
||||||
connectionsMap map[string]*mcuProxyConnection
|
connectionsMap map[string]*mcuProxyConnection
|
||||||
connectionsMu sync.RWMutex
|
connectionsMu sync.RWMutex
|
||||||
connRequests int64
|
|
||||||
nextSort int64
|
|
||||||
proxyTimeout time.Duration
|
proxyTimeout time.Duration
|
||||||
|
|
||||||
mu sync.RWMutex
|
mu sync.RWMutex
|
||||||
|
|
Loading…
Reference in a new issue