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
66de0d16
Commit
66de0d16
authored
Feb 04, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix closing of replaced connections.
parent
fe9b8925
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
22 deletions
+30
-22
rtpconn/webclient.go
rtpconn/webclient.go
+30
-22
No files found.
rtpconn/webclient.go
View file @
66de0d16
...
...
@@ -831,23 +831,27 @@ func clientLoop(c *webClient, ws *websocket.Conn) error {
if
g
==
nil
||
a
.
group
!=
g
{
return
nil
}
if
a
.
conn
==
nil
{
var
tracks
[]
conn
.
UpTrack
if
a
.
conn
!=
nil
{
tracks
=
make
([]
conn
.
UpTrack
,
0
,
len
(
a
.
tracks
),
)
for
_
,
t
:=
range
a
.
tracks
{
if
c
.
isRequested
(
t
.
Label
())
{
tracks
=
append
(
tracks
,
t
,
)
}
}
}
if
len
(
tracks
)
==
0
{
closeDownConn
(
c
,
a
.
id
,
""
)
if
a
.
replace
!=
""
{
closeDownConn
ection
(
closeDownConn
(
c
,
a
.
replace
,
""
,
)
}
closeDownConnection
(
c
,
a
.
id
,
""
)
continue
}
tracks
:=
make
([]
conn
.
UpTrack
,
0
,
len
(
a
.
tracks
))
for
_
,
t
:=
range
a
.
tracks
{
if
c
.
isRequested
(
t
.
Label
())
{
tracks
=
append
(
tracks
,
t
)
}
}
if
len
(
tracks
)
==
0
{
closeDownConnection
(
c
,
a
.
id
,
""
)
continue
}
...
...
@@ -859,6 +863,12 @@ func clientLoop(c *webClient, ws *websocket.Conn) error {
if
err
!=
nil
{
return
err
}
if
a
.
replace
!=
""
{
err
:=
delDownConn
(
c
,
a
.
replace
)
if
err
!=
nil
{
log
.
Printf
(
"Replace: %v"
,
err
)
}
}
err
=
negotiate
(
c
,
down
,
false
,
a
.
replace
,
)
...
...
@@ -866,10 +876,8 @@ func clientLoop(c *webClient, ws *websocket.Conn) error {
log
.
Printf
(
"Negotiation failed: %v"
,
err
)
delDownConn
(
c
,
down
.
id
)
c
.
error
(
group
.
UserError
(
"Negotiation failed"
,
))
closeDownConn
(
c
,
down
.
id
,
"negotiation failed"
)
continue
}
case
pushConnsAction
:
...
...
@@ -1020,7 +1028,7 @@ func leaveGroup(c *webClient) {
c
.
group
=
nil
}
func
closeDownConn
ection
(
c
*
webClient
,
id
string
,
message
string
)
error
{
func
closeDownConn
(
c
*
webClient
,
id
string
,
message
string
)
error
{
err
:=
delDownConn
(
c
,
id
)
if
err
!=
nil
&&
!
os
.
IsNotExist
(
err
)
{
log
.
Printf
(
"Close down connection: %v"
,
err
)
...
...
@@ -1220,7 +1228,7 @@ func handleClientMessage(c *webClient, m clientMessage) error {
if
err
!=
ErrUnknownId
{
message
=
"negotiation failed"
}
return
closeDownConn
ection
(
c
,
m
.
Id
,
message
)
return
closeDownConn
(
c
,
m
.
Id
,
message
)
}
down
:=
getDownConn
(
c
,
m
.
Id
)
if
down
.
negotiationNeeded
>
negotiationUnneeded
{
...
...
@@ -1230,7 +1238,7 @@ func handleClientMessage(c *webClient, m clientMessage) error {
""
,
)
if
err
!=
nil
{
return
closeDownConn
ection
(
return
closeDownConn
(
c
,
m
.
Id
,
"negotiation failed"
,
)
}
...
...
@@ -1240,7 +1248,7 @@ func handleClientMessage(c *webClient, m clientMessage) error {
if
down
!=
nil
{
err
:=
negotiate
(
c
,
down
,
true
,
""
)
if
err
!=
nil
{
return
closeDownConn
ection
(
return
closeDownConn
(
c
,
m
.
Id
,
"renegotiation failed"
,
)
}
...
...
@@ -1255,7 +1263,7 @@ func handleClientMessage(c *webClient, m clientMessage) error {
return
nil
}
case
"abort"
:
return
closeDownConn
ection
(
c
,
m
.
Id
,
""
)
return
closeDownConn
(
c
,
m
.
Id
,
""
)
case
"ice"
:
if
m
.
Candidate
==
nil
{
return
group
.
ProtocolError
(
"null candidate"
)
...
...
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