File: fix-listen-test.patch

package info (click to toggle)
node-nodeunit 0.11.3%2Bds-5~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,076 kB
  • sloc: javascript: 3,323; makefile: 141
file content (23 lines) | stat: -rw-r--r-- 698 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Description: test assumes server.listen is immediate
 This software is no longer maintained upstream. Not forwarding.
Forwarded: not-needed
Author: Jérémy Lal <kapouer@melix.org>
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -177,7 +177,6 @@
     var port = process.env.PORT || 3000;
 
     var server = http.createServer(cgi);
-    server.listen(port, hostname);
 
     var agent = new http.Agent({ host: hostname, port: port, maxSockets: 1 });
     var client = {
@@ -210,7 +209,7 @@
         }
     };
 
-    process.nextTick(function () {
+    server.listen(port, hostname, function () {
         if (envReady && typeof envReady === 'function') {
             envReady(server, client);
         }