Skip to content

Commit a21134d

Browse files
Jeroen van Veenjech
Jeroen van Veen
authored andcommitted
Fix usage of serverConnection in protocol.js
serverConnection is the global value in galene.js.
1 parent c5e5455 commit a21134d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

static/protocol.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,7 @@ TransferredFile.prototype.receive = async function() {
17901790
throw new Error('Receiving in wrong direction');
17911791
if(f.pc)
17921792
throw new Error('Download already in progress');
1793-
let pc = new RTCPeerConnection(serverConnection.getRTCConfiguration());
1793+
let pc = new RTCPeerConnection(f.sc.getRTCConfiguration());
17941794
if(!pc) {
17951795
let err = new Error("Couldn't create peer connection");
17961796
f.fail(err);
@@ -1807,7 +1807,7 @@ TransferredFile.prototype.receive = async function() {
18071807
}
18081808
};
18091809
pc.onicecandidate = function(e) {
1810-
serverConnection.userMessage('filetransfer', f.userid, {
1810+
f.sc.userMessage('filetransfer', f.userid, {
18111811
type: 'downice',
18121812
id: f.id,
18131813
candidate: e.candidate,
@@ -1851,7 +1851,7 @@ TransferredFile.prototype.answer = async function(sdp) {
18511851
throw new Error('Sending file in wrong direction');
18521852
if(f.pc)
18531853
throw new Error('Transfer already in progress');
1854-
let pc = new RTCPeerConnection(serverConnection.getRTCConfiguration());
1854+
let pc = new RTCPeerConnection(f.sc.getRTCConfiguration());
18551855
if(!pc) {
18561856
let err = new Error("Couldn't create peer connection");
18571857
f.fail(err);
@@ -1862,7 +1862,7 @@ TransferredFile.prototype.answer = async function(sdp) {
18621862

18631863
f.candidates = [];
18641864
pc.onicecandidate = function(e) {
1865-
serverConnection.userMessage('filetransfer', f.userid, {
1865+
f.sc.userMessage('filetransfer', f.userid, {
18661866
type: 'upice',
18671867
id: f.id,
18681868
candidate: e.candidate,
@@ -1910,7 +1910,7 @@ TransferredFile.prototype.answer = async function(sdp) {
19101910
if(!answer)
19111911
throw new Error("Couldn't create answer");
19121912
await pc.setLocalDescription(answer);
1913-
serverConnection.userMessage('filetransfer', f.userid, {
1913+
f.sc.userMessage('filetransfer', f.userid, {
19141914
type: 'answer',
19151915
id: f.id,
19161916
sdp: pc.localDescription.sdp,

0 commit comments

Comments
 (0)