mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-31 10:31:36 +00:00
Merge pull request #150 from feross/fix-148
Fix "Error: listener must be a function"
This commit is contained in:
commit
de1e206fec
12
server.js
12
server.js
@ -713,13 +713,19 @@ Server.prototype._onWebSocketClose = function (socket) {
|
|||||||
socket.peerId = null
|
socket.peerId = null
|
||||||
socket.infoHashes = null
|
socket.infoHashes = null
|
||||||
|
|
||||||
socket.removeListener('message', socket.onMessageBound)
|
if (typeof socket.onMessageBound === 'function') {
|
||||||
|
socket.removeListener('message', socket.onMessageBound)
|
||||||
|
}
|
||||||
socket.onMessageBound = null
|
socket.onMessageBound = null
|
||||||
|
|
||||||
socket.removeListener('error', socket.onErrorBound)
|
if (typeof socket.onErrorBound === 'function') {
|
||||||
|
socket.removeListener('error', socket.onErrorBound)
|
||||||
|
}
|
||||||
socket.onErrorBound = null
|
socket.onErrorBound = null
|
||||||
|
|
||||||
socket.removeListener('close', socket.onCloseBound)
|
if (typeof socket.onCloseBound === 'function') {
|
||||||
|
socket.removeListener('close', socket.onCloseBound)
|
||||||
|
}
|
||||||
socket.onCloseBound = null
|
socket.onCloseBound = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user