Skip to content

Commit

Permalink
Catch keyword TTL instead of round-trip time
Browse files Browse the repository at this point in the history
--Overview
1. According to Issue #17, catching ```TTL``` is better than catching
```rountd-trip```
  • Loading branch information
mondwan authored and Mond Wan committed Nov 7, 2014
1 parent 5c92c97 commit f5f69ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ping-promise.js
Expand Up @@ -113,7 +113,7 @@ function probe(addr, config) {
// this is my solution on Chinese Windows8 64bit
result = false;
for (var t = 0; t < lines.length; t++) {
if (lines[t].indexOf('round trip time') > 0) {
if (lines[t].search(/TTL=[0-9]+/i) > 0) {
result = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ping-sys.js
Expand Up @@ -60,7 +60,7 @@ function probe(addr, cb) {
var lines = outstring.split('\n');
result = false;
for (var t = 0; t < lines.length; t++) {
if (lines[t].indexOf('round trip time') > 0) {
if (lines[t].search(/TTL=[0-9]+/i) > 0) {
result = true;
break;
}
Expand Down

0 comments on commit f5f69ab

Please sign in to comment.