mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 20:21:36 +00:00
fixed issue where an erroneous tracker could cause webtorrent to crash because socket.close was already closed after an error state
This commit is contained in:
parent
50d3379255
commit
c4684c8b72
6
index.js
6
index.js
@ -180,13 +180,11 @@ Tracker.prototype._requestUdp = function (requestUrl, opts) {
|
||||
|
||||
function error (message) {
|
||||
self.client.emit('error', new Error(message + ' (connecting to tracker ' + requestUrl + ')'))
|
||||
socket.close()
|
||||
try { socket.close() } catch (e) { }
|
||||
clearTimeout(timeout)
|
||||
}
|
||||
|
||||
socket.on('error', function (err) {
|
||||
error(err)
|
||||
})
|
||||
socket.on('error', error)
|
||||
|
||||
socket.on('message', function (message, rinfo) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user