Skip to content

Commit efa1562

Browse files
committed
don't reply to http requests after server has stopped listening
1 parent da0382a commit efa1562

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ Server.prototype.onHttpRequest = function (req, res, opts) {
183183
'failure reason': err.message
184184
}
185185
}
186+
if (!self.listening) return
186187

187188
delete response.action // only needed for UDP encoding
188189
res.end(bencode.encode(response))

0 commit comments

Comments
 (0)