Skip to content

Commit 3ceeaa0

Browse files
committed
Minor changes
1 parent 46ab6f8 commit 3ceeaa0

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

lib/jsflow-tracker.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,19 @@ jsFlowTracker.prototype._onWebRtcIce = function (payload, from) {
220220
if(peer) {
221221
if(payload.candidate) {
222222
peer.signal(payload)
223-
}
223+
}
224+
}
224225
else {
225226
console.error('Candidate did not exist as expected in payload', payload);
226227
}
227228
}
228229
else {
229230
console.error('Candidate refers to a peer not yet created. Buffering ICE!', payload);
230231
self.storeIce.push(payload.candidate)
231-
}
232232
}
233+
233234
}
235+
234236
jsFlowTracker.prototype._sendAnnounce = function (params) {
235237
var self = this
236238
jsFlow.messageUser(params.trackerid, params, 'announce')
@@ -240,11 +242,12 @@ function processStoredCandidates (tracker, from) {
240242
console.log("Processing stored candidates.")
241243
var peer = tracker._peers[from]
242244
tracker.storeIce.forEach(function(candidate){
243-
if(peer) {
244-
peer.signal(candidate)
245-
}
246-
else {
247-
console.error('Candidate did not exist as expected in payload', payload);
248-
}
245+
var params = {
246+
info_hash: self.client._infoHash.toString('base64'),
247+
peer_id: self._peerID,
248+
candidate: signalObject.candidate
249+
}
250+
251+
jsFlow.messageUser(from, params, 'webrtc_ice');
249252
})
250253
}

0 commit comments

Comments
 (0)