Skip to content

Commit

Permalink
Print peer ID in unidentifiable log messages
Browse files Browse the repository at this point in the history
Some log messages did not provide any way to identify which peer they
refer to, so the peer ID is now printed in them.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
  • Loading branch information
danxuliu committed Jul 4, 2022
1 parent 9c0d1d3 commit b8df345
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/utils/webrtc/webrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@ function checkStartPublishOwnPeer(signaling) {
}

if (currentSessionId !== signaling.getSessionId()) {
console.debug('No answer received for own peer but current session id changed, not sending offer again')
console.debug('No answer received for own peer but current session id changed, not sending offer again', currentSessionId, signaling.getSessionId())

clearInterval(delayedConnectionToPeer[currentSessionId])
delete delayedConnectionToPeer[currentSessionId]

return
}

console.debug('No answer received for own peer, sending offer again')
console.debug('No answer received for own peer, sending offer again', currentSessionId)
createPeer()
}, 10000)
}
Expand Down Expand Up @@ -372,15 +372,15 @@ function usersChanged(signaling, newUsers, disconnectedSessionIds) {
clearInterval(delayedConnectionToPeer[user.sessionId])

delayedConnectionToPeer[user.sessionId] = setInterval(function() {
console.debug('No offer received for new peer, request offer again')
console.debug('No offer received for new peer, request offer again', sessionId)

signaling.requestOffer(user, 'video')
}, 10000)
} else if (!useMcu && userHasStreams(selfInCall) && (!userHasStreams(user) || sessionId < currentSessionId)) {
// To avoid overloading the user joining a room (who previously called
// all the other participants), we decide who calls who by comparing
// the session ids of the users: "larger" ids call "smaller" ones.
console.debug('Starting call with', user)
console.debug('Starting call with', user, sessionId)
createPeer()
} else if (!useMcu && userHasStreams(selfInCall) && userHasStreams(user) && sessionId > currentSessionId) {
// If the remote peer is not aware that it was disconnected
Expand All @@ -398,11 +398,11 @@ function usersChanged(signaling, newUsers, disconnectedSessionIds) {
peer.end()
})

console.debug('No offer nor answer received, sending offer again')
console.debug('No offer nor answer received, sending offer again', sessionId)
createPeer()
}, 10000)
} else {
console.debug('User has no streams, not sending another offer')
console.debug('User has no streams, not sending another offer', sessionId)
}
}

Expand Down Expand Up @@ -1575,10 +1575,10 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local
} else if (data.type === 'speaking' || data.type === 'stoppedSpeaking') {
// Valid known messages, but handled elsewhere
} else {
console.debug('Unknown message type %s from %s datachannel', data.type, label, data)
console.debug('Unknown message type %s from %s datachannel', data.type, label, data, peer.id, peer)
}
} else {
console.debug('Unknown message from %s datachannel', label, data)
console.debug('Unknown message from %s datachannel', label, data, peer.id, peer)
}
})

Expand Down

0 comments on commit b8df345

Please sign in to comment.