Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
515c4a5c
Commit
515c4a5c
authored
May 14, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename pushConns to requestConns, move into Client interface.
Also allow selecting just a single connection.
parent
435f46c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
13 deletions
+23
-13
diskwriter/diskwriter.go
diskwriter/diskwriter.go
+4
-0
group/client.go
group/client.go
+1
-0
rtpconn/webclient.go
rtpconn/webclient.go
+18
-13
No files found.
diskwriter/diskwriter.go
View file @
515c4a5c
...
...
@@ -79,6 +79,10 @@ func (client *Client) PushClient(id, username string, permissions *group.ClientP
return
nil
}
func
(
client
*
Client
)
RequestConns
(
target
group
.
Client
,
g
*
group
.
Group
,
id
string
)
error
{
return
nil
}
func
(
client
*
Client
)
Close
()
error
{
client
.
mu
.
Lock
()
defer
client
.
mu
.
Unlock
()
...
...
group/client.go
View file @
515c4a5c
...
...
@@ -101,6 +101,7 @@ type Client interface {
Status
()
map
[
string
]
interface
{}
OverridePermissions
(
*
Group
)
bool
PushConn
(
g
*
Group
,
id
string
,
conn
conn
.
Up
,
tracks
[]
conn
.
UpTrack
,
replace
string
)
error
RequestConns
(
target
Client
,
g
*
Group
,
id
string
)
error
PushClient
(
id
,
username
string
,
permissions
*
ClientPermissions
,
status
map
[
string
]
interface
{},
kind
string
)
error
Kick
(
id
,
user
,
message
string
)
error
}
rtpconn/webclient.go
View file @
515c4a5c
...
...
@@ -644,17 +644,18 @@ func (c *webClient) setRequested(requested map[string][]string) error {
}
c
.
requested
=
requested
pushConns
(
c
,
c
.
group
)
requestConns
(
c
,
c
.
group
,
""
)
return
nil
}
func
pushConns
(
c
group
.
Client
,
g
*
group
.
Group
)
{
clients
:=
g
.
GetClients
(
c
)
for
_
,
cc
:=
range
clients
{
ccc
,
ok
:=
cc
.
(
*
webClient
)
if
ok
{
ccc
.
action
(
pushConnsAction
{
g
,
c
})
}
func
(
c
*
webClient
)
RequestConns
(
target
group
.
Client
,
g
*
group
.
Group
,
id
string
)
error
{
return
c
.
action
(
requestConnsAction
{
g
,
target
,
id
})
}
func
requestConns
(
target
group
.
Client
,
g
*
group
.
Group
,
id
string
)
{
clients
:=
g
.
GetClients
(
target
)
for
_
,
c
:=
range
clients
{
c
.
RequestConns
(
target
,
g
,
id
)
}
}
...
...
@@ -801,9 +802,10 @@ type pushConnAction struct {
replace
string
}
type
push
ConnsAction
struct
{
type
request
ConnsAction
struct
{
group
*
group
.
Group
client
group
.
Client
target
group
.
Client
id
string
}
type
connectionFailedAction
struct
{
...
...
@@ -933,12 +935,15 @@ func handleAction(c *webClient, a interface{}) error {
closeDownConn
(
c
,
down
.
id
,
"negotiation failed"
)
}
case
push
ConnsAction
:
case
request
ConnsAction
:
g
:=
c
.
group
if
g
==
nil
||
a
.
group
!=
g
{
return
nil
}
for
_
,
u
:=
range
c
.
up
{
if
a
.
id
!=
""
&&
a
.
id
!=
u
.
id
{
continue
}
tracks
:=
u
.
getTracks
()
replace
:=
u
.
getReplace
(
false
)
...
...
@@ -946,7 +951,7 @@ func handleAction(c *webClient, a interface{}) error {
for
i
,
t
:=
range
tracks
{
ts
[
i
]
=
t
}
err
:=
a
.
clien
t
.
PushConn
(
g
,
u
.
id
,
u
,
ts
,
replace
)
err
:=
a
.
targe
t
.
PushConn
(
g
,
u
.
id
,
u
,
ts
,
replace
)
if
err
!=
nil
{
log
.
Printf
(
"PushConn: %v"
,
err
)
}
...
...
@@ -1417,7 +1422,7 @@ func handleClientMessage(c *webClient, m clientMessage) error {
disk
.
Close
()
return
c
.
error
(
err
)
}
pushConns
(
disk
,
c
.
group
)
requestConns
(
disk
,
c
.
group
,
""
)
case
"unrecord"
:
if
!
c
.
permissions
.
Record
{
return
c
.
error
(
group
.
UserError
(
"not authorised"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment