mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-22 07:46:17 -04:00
Fix bug where clients try to re-answer established connections.
This commit is contained in:
parent
a251483e97
commit
0b743fa091
1 changed files with 8 additions and 2 deletions
|
@ -273,8 +273,14 @@ class RTCPeer extends Peer {
|
||||||
|
|
||||||
if (message.sdp) {
|
if (message.sdp) {
|
||||||
this._conn.setRemoteDescription(new RTCSessionDescription(message.sdp))
|
this._conn.setRemoteDescription(new RTCSessionDescription(message.sdp))
|
||||||
.then( _ => this._conn.createAnswer())
|
.then( _ => {
|
||||||
.then(d => this._onDescription(d))
|
if (message.sdp.type == 'offer') {
|
||||||
|
return this._conn.createAnswer()
|
||||||
|
.then(d => this._onDescription(d));
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
})
|
||||||
.catch(e => this._onError(e));
|
.catch(e => this._onError(e));
|
||||||
} else if (message.ice) {
|
} else if (message.ice) {
|
||||||
this._conn.addIceCandidate(new RTCIceCandidate(message.ice));
|
this._conn.addIceCandidate(new RTCIceCandidate(message.ice));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue