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
37128979
Commit
37128979
authored
Jan 12, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call onclose on up streams too.
parent
820b303e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
static/protocol.js
static/protocol.js
+13
-7
No files found.
static/protocol.js
View file @
37128979
...
...
@@ -236,12 +236,15 @@ ServerConnection.prototype.connect = async function(url) {
};
this
.
socket
.
onclose
=
function
(
e
)
{
sc
.
permissions
=
{};
for
(
let
id
in
sc
.
up
)
{
let
c
=
sc
.
up
[
id
];
delete
(
sc
.
up
[
id
]);
c
.
close
();
}
for
(
let
id
in
sc
.
down
)
{
let
c
=
sc
.
down
[
id
];
delete
(
sc
.
down
[
id
]);
c
.
close
();
if
(
c
.
onclose
)
c
.
onclose
.
call
(
c
);
}
if
(
sc
.
group
&&
sc
.
onjoined
)
sc
.
onjoined
.
call
(
sc
,
'
leave
'
,
sc
.
group
,
{},
''
);
...
...
@@ -528,7 +531,7 @@ ServerConnection.prototype.gotOffer = async function(id, labels, source, usernam
// Unless the server indicates that this is a renegotiation with
// all parameters unchanged, tear down the existing connection.
delete
(
sc
.
down
[
id
]);
c
.
close
();
c
.
close
(
true
);
c
=
null
;
}
...
...
@@ -634,7 +637,7 @@ ServerConnection.prototype.gotAnswer = async function(id, sdp) {
if
(
c
.
onerror
)
c
.
onerror
.
call
(
c
,
e
);
}
finally
{
c
.
close
();
c
.
close
(
true
);
}
return
;
}
...
...
@@ -668,8 +671,6 @@ ServerConnection.prototype.gotClose = function(id) {
throw
new
Error
(
'
unknown down stream
'
);
delete
(
this
.
down
[
id
]);
c
.
close
();
if
(
c
.
onclose
)
c
.
onclose
.
call
(
c
);
};
/**
...
...
@@ -882,8 +883,10 @@ function Stream(sc, id, pc, up) {
* For streams in the up direction, this may be called at any time. For
* streams in the down direction, this will be called automatically when
* the server signals that it is closing a stream.
*
* @param {boolean} [nocallback]
*/
Stream
.
prototype
.
close
=
function
()
{
Stream
.
prototype
.
close
=
function
(
nocallback
)
{
let
c
=
this
;
if
(
c
.
statsHandler
)
{
clearInterval
(
c
.
statsHandler
);
...
...
@@ -909,6 +912,9 @@ Stream.prototype.close = function() {
}
catch
(
e
)
{
}
}
if
(
!
nocallback
&&
c
.
onclose
)
c
.
onclose
.
call
(
c
);
c
.
sc
=
null
;
};
...
...
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