From 29518c17bea427924bb2179ea1b5429f89850266 Mon Sep 17 00:00:00 2001 From: Alexis Campailla Date: Fri, 2 May 2014 11:22:19 -0400 Subject: [PATCH] test: fix test-http-flush on Windows On Windows we cannot get the server address until a connection is accepted. From MSDN: The getsockname function does not always return information about the host address when the socket has been bound to an unspecified address, unless the socket has been connected with connect or accept (for example, using ADDR_ANY). A Windows Sockets application must not assume that the address will be specified unless the socket is connected. Signed-off-by: Timothy J Fontaine --- test/simple/test-http-flush.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/simple/test-http-flush.js b/test/simple/test-http-flush.js index 7da94e89dc..842cf8729e 100644 --- a/test/simple/test-http-flush.js +++ b/test/simple/test-http-flush.js @@ -26,11 +26,11 @@ var http = require('http'); http.createServer(function(req, res) { res.end('ok'); this.close(); -}).listen(function() { +}).listen(common.PORT, '127.0.0.1', function() { var req = http.request({ method: 'POST', - host: this.address().address, - port: this.address().port, + host: '127.0.0.1', + port: common.PORT, }); req.flush(); // Flush the request headers. req.flush(); // Should be idempotent.