systeminformation 5.23.11 → 5.23.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/network.js +3 -2
- package/package.json +1 -1
package/lib/network.js
CHANGED
|
@@ -1534,7 +1534,6 @@ function networkConnections(callback) {
|
|
|
1534
1534
|
});
|
|
1535
1535
|
}
|
|
1536
1536
|
if (_darwin) {
|
|
1537
|
-
// let cmd = 'netstat -natv | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"';
|
|
1538
1537
|
let cmd = 'netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"';
|
|
1539
1538
|
const states = 'ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT_1|FIN_WAIT2|FIN_WAIT_2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN';
|
|
1540
1539
|
exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {
|
|
@@ -1544,8 +1543,10 @@ function networkConnections(callback) {
|
|
|
1544
1543
|
processes = processes.map((line => { return line.trim().replace(/ +/g, ' '); }));
|
|
1545
1544
|
let lines = stdout.toString().split('\n');
|
|
1546
1545
|
|
|
1546
|
+
|
|
1547
1547
|
lines.forEach(function (line) {
|
|
1548
1548
|
line = line.replace(/ +/g, ' ').split(' ');
|
|
1549
|
+
const hasTransferred = line.length >= 19;
|
|
1549
1550
|
if (line.length >= 8) {
|
|
1550
1551
|
let localip = line[3];
|
|
1551
1552
|
let localport = '';
|
|
@@ -1565,7 +1566,7 @@ function networkConnections(callback) {
|
|
|
1565
1566
|
}
|
|
1566
1567
|
const hasState = states.indexOf(line[5]) >= 0;
|
|
1567
1568
|
let connstate = hasState ? line[5] : 'UNKNOWN';
|
|
1568
|
-
let pid = parseInt(line[8 + (hasState ? 0 : -1)], 10);
|
|
1569
|
+
let pid = parseInt(line[8 + (hasState ? 0 : -1) + (hasTransferred ? 2 : 0)], 10);
|
|
1569
1570
|
if (connstate) {
|
|
1570
1571
|
result.push({
|
|
1571
1572
|
protocol: line[0],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.23.
|
|
3
|
+
"version": "5.23.12",
|
|
4
4
|
"description": "Advanced, lightweight system and OS information library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
|