mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-02-07 13:59:07 +00:00
fixes for simple-websocket@4
This commit is contained in:
parent
de234ac8b0
commit
ad580c3d7c
@ -128,8 +128,11 @@ WebSocketTracker.prototype._onSocketData = function (data) {
|
|||||||
var self = this
|
var self = this
|
||||||
if (self.destroyed) return
|
if (self.destroyed) return
|
||||||
|
|
||||||
if (!(typeof data === 'object' && data !== null)) {
|
try {
|
||||||
return self.client.emit('warning', new Error('Invalid tracker response'))
|
data = JSON.parse(data)
|
||||||
|
} catch (err) {
|
||||||
|
self.client.emit('warning', new Error('Invalid tracker response'))
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.info_hash !== self.client._infoHashBinary) {
|
if (data.info_hash !== self.client._infoHashBinary) {
|
||||||
|
Loading…
Reference in New Issue
Block a user