Skip to content
Permalink
Browse files

Revert "Prevent ending Jingle session multiple times"

This reverts commit c367c71.
  • Loading branch information
legastero committed Nov 15, 2019
1 parent 1e7b93f commit 583d4554b338b54225cde8ce3a2fb0f14c85c77a
Showing with 1 addition and 21 deletions.
  1. +1 −14 src/jingle/ICESession.ts
  2. +0 −7 src/jingle/Session.ts
@@ -62,10 +62,6 @@ export default class ICESession extends BaseSession {
}

public end(reason: JingleReasonCondition | JingleReason = 'success', silent: boolean = false) {
if (this._ending) {
return;
}
this._ending = true;
this.pc.close();
super.end(reason, silent);
}
@@ -389,31 +385,22 @@ export default class ICESession extends BaseSession {
} else {
this.connectionState = 'disconnected';
}
if (this.restartingIce && !this._ending) {
if (this.restartingIce) {
this.end(JingleReasonCondition.FailedTransport);
return;
}
this.maybeRestartIce();
break;
case 'failed':
if (this._ending) {
this.connectionState = 'failed';
return;
}

if (this.connectionState === 'failed' || this.restartingIce) {
this.end(JingleReasonCondition.FailedTransport);
return;
}

this.connectionState = 'failed';
this.restartIce();
break;
case 'closed':
this.connectionState = 'disconnected';
if (this._ending) {
return;
}
if (this.restartingIce) {
this.end(JingleReasonCondition.FailedTransport);
} else {
@@ -54,8 +54,6 @@ export default class JingleSession {

public processingQueue: async.AsyncPriorityQueue<any>;

protected _ending: boolean = false;

private _sessionState: string;
private _connectionState: string;

@@ -271,11 +269,6 @@ export default class JingleSession {
public end(reason: JingleReasonCondition | JingleReason = 'success', silent: boolean = false) {
this.state = 'ended';

if (this._ending) {
return;
}
this._ending = true;

this.processingQueue.kill();

if (typeof reason === 'string') {

0 comments on commit 583d455

Please sign in to comment.
You can’t perform that action at this time.