Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,15 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) {
}
if (self.destroyed) return

var hashes
if (typeof params.info_hash === 'string') hashes = [ params.info_hash ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already happens in parse-websocket.js

else hashes = params.info_hash
hashes.forEach(function (info_hash) {
if (socket.infoHashes.indexOf(info_hash) === -1) {
socket.infoHashes.push(info_hash)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only happen for announce. I will move it into the if statement below.

}
})

response.action = params.action === common.ACTIONS.ANNOUNCE ? 'announce' : 'scrape'

var peers
Expand Down