Bug 1287236 - Use 0 instead of -1 to randomly assign port. r=mcmanus
authorNicholas Hurley <hurley@todesschaf.org>
Fri, 15 Jul 2016 14:30:56 -0700
changeset 305116 059794b8004eba9378d28c9d584c905c40a33f04
parent 305115 9ee862a030f350e481e3fa3a09d6dc28d4dbf591
child 305235 53900593419c215f37e70c40763ca8b45d86ecb5
push id30632
push userhurley@todesschaf.org
push dateSat, 16 Jul 2016 21:39:13 +0000
treeherderautoland@059794b8004e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1287236
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1287236 - Use 0 instead of -1 to randomly assign port. r=mcmanus MozReview-Commit-ID: WkP2s0Pgxc
testing/xpcshell/moz-http2/moz-http2.js
testing/xpcshell/moz-spdy/moz-spdy.js
--- a/testing/xpcshell/moz-http2/moz-http2.js
+++ b/testing/xpcshell/moz-http2/moz-http2.js
@@ -760,17 +760,17 @@ server.on('connection', function(socket)
   });
 });
 
 var serverPort;
 function listenok() {
   serverPort = server._server.address().port;
   console.log('HTTP2 server listening on port ' + serverPort);
 }
-var portSelection = -1;
+var portSelection = 0;
 var envport = process.env.MOZHTTP2_PORT;
 if (envport !== undefined) {
   try {
     portSelection = parseInt(envport, 10);
   } catch (e) {
     portSelection = -1;
   }
 }
--- a/testing/xpcshell/moz-spdy/moz-spdy.js
+++ b/testing/xpcshell/moz-spdy/moz-spdy.js
@@ -183,15 +183,15 @@ var options = {
   ca: fs.readFileSync(__dirname + '/spdy-ca.pem'),
   windowSize: 16000000,
 };
 
 function listenok() {
   console.log('SPDY server listening on port ' + webServer.address().port);
 }
 
-var webServer = spdy.createServer(options, handleRequest).listen(-1, "0.0.0.0", 200, listenok);
+var webServer = spdy.createServer(options, handleRequest).listen(0, "0.0.0.0", 200, listenok);
 
 // Set up to exit when the user finishes our stdin
 process.stdin.resume();
 process.stdin.on('end', function () {
   process.exit();
 });