diff --git a/server.js b/server.js index 7644c94..07e41e8 100644 --- a/server.js +++ b/server.js @@ -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))