don't reply to http requests after server has stopped listening

This commit is contained in:
Feross Aboukhadijeh 2015-05-01 14:21:09 -07:00
parent da0382a435
commit efa15629dd

View File

@ -183,6 +183,7 @@ Server.prototype.onHttpRequest = function (req, res, opts) {
'failure reason': err.message
}
}
if (!self.listening) return
delete response.action // only needed for UDP encoding
res.end(bencode.encode(response))