From 340b3faff222977a353ab3eb6f4aea0318010b82 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 27 May 2015 12:59:12 +0200 Subject: [PATCH] server: always send binary ids --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index b27420f..caec3a9 100644 --- a/server.js +++ b/server.js @@ -275,7 +275,7 @@ Server.prototype._onWebSocketRequest = function (socket, params) { } catch (err) { socket.send(JSON.stringify({ 'failure reason': err.message, - info_hash: params.info_hash + info_hash: common.hexToBinary(params.info_hash) }), socket.onSend) // even though it's an error for the client, it's just a warning for the server. @@ -302,7 +302,7 @@ Server.prototype._onWebSocketRequest = function (socket, params) { var peers = response.peers delete response.peers response.interval = self._intervalMs - response.info_hash = params.info_hash // as hex + response.info_hash = common.hexToBinary(params.info_hash) socket.send(JSON.stringify(response), socket.onSend) debug('sent response %s to %s', JSON.stringify(response), params.peer_id)