Skip to content

Commit

Permalink
Update portscanner.js
Browse files Browse the repository at this point in the history
Added Flipped the order of the check...sometime we don't care about an error if the status matches.  In the case of looking for an port not in use we actually want the timeout to trip.
  • Loading branch information
skilesare committed Feb 4, 2014
1 parent d3b029c commit c1544a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/portscanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ function findAPortWithStatus(status, startPort, endPort, host, callback) {
var checkNextPort = function(callback) {
portscanner.checkPortStatus(port, host, function(error, statusOfPort) {
numberOfPortsChecked++
if (error) {
callback(error)
}
else if (statusOfPort === status) {
if (statusOfPort === status) {
foundPort = true
callback(null, port)
}
else if (error) {
callback(error)
}
else {
port++
callback(null, false)
Expand Down

0 comments on commit c1544a1

Please sign in to comment.