check for params.offers to determine if offers were received

This commit is contained in:
Feross Aboukhadijeh 2016-03-15 20:06:53 -07:00
parent ba4a52d2d1
commit 7a7ed575e1

View File

@ -353,8 +353,8 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) {
socket.send(JSON.stringify(response), socket.onSend) socket.send(JSON.stringify(response), socket.onSend)
debug('sent response %s to %s', JSON.stringify(response), params.peer_id) debug('sent response %s to %s', JSON.stringify(response), params.peer_id)
if (params.numwant) { if (params.offers) {
debug('got offers %s from %s', JSON.stringify(params.offers), params.peer_id) debug('got offers %o from %s', params.offers, params.peer_id)
debug('got %s peers from swarm %s', peers.length, params.info_hash) debug('got %s peers from swarm %s', peers.length, params.info_hash)
peers.forEach(function (peer, i) { peers.forEach(function (peer, i) {
peer.socket.send(JSON.stringify({ peer.socket.send(JSON.stringify({