Skip to content
Snippets Groups Projects
Commit dce12b2f authored by Bastien Roucariès's avatar Bastien Roucariès
Browse files

Avoid EINUSE

parent 1eb79b00
No related branches found
No related tags found
No related merge requests found
node-http-server (14.1.1+~cs3.14.34-3) unstable; urgency=medium
* Team upload
* Avoid EINUSE in autopkgtest
-- Bastien Roucariès <rouca@debian.org> Thu, 01 Aug 2024 18:57:12 +0000
node-http-server (14.1.1+~cs3.14.34-2) unstable; urgency=medium
* Team upload
......
From: sla89 <skullsplitter@die-optimisten.net>
Date: Thu, 1 Aug 2024 18:43:45 +0000
Subject: Wait until server is closed before invoking callback
Will avoid a EINUSE error
origin: https://github.com/http-party/node-portfinder/commit/394533f6164d1f44f0c8ea7bba5857b804928918.patch
bug: https://github.com/http-party/node-portfinder/issues/104
bug-pull-request: https://github.com/http-party/node-portfinder/pull/105
---
portfinder/lib/portfinder.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/portfinder/lib/portfinder.js b/portfinder/lib/portfinder.js
index e798f69..0c4fb17 100644
--- a/portfinder/lib/portfinder.js
+++ b/portfinder/lib/portfinder.js
@@ -39,8 +39,10 @@ internals.testPort = function(options, callback) {
debugTestPort("done w/ testPort(): OK", options.host, "port", options.port);
options.server.removeListener('error', onError);
- options.server.close();
- callback(null, options.port);
+ options.server.close(function () {
+ debugTestPort("done w/ testPort(): Server closed", options.host, "port", options.port);
+ callback(null, options.port);
+ });
}
function onError (err) {
......@@ -3,3 +3,4 @@ remove-unnecessary-shebang-line.patch
drop-secure-compare-dependency.patch
drop-url-join-dependency.patch
use-mime3.patch
0006-Wait-until-server-is-closed-before-invoking-callback.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment