Commit 99021ae
committed
fix: add fallback for ss builds that reject sport filter
- Some ss builds don't support 'sport = :port' filter syntax
- Detect filter failure (empty stdout, stderr mentions 'filter')
- Fallback to unfiltered 'ss -tlnp' and parse full output
- Use regex to match exact port with word boundary (e.g., :8888\b)
- Extract pid=NUMBER from matching lines only
- Prevents false positives (port 8888 won't match 88880)
- Maintains Set<number> for automatic PID deduplication
- Preserves throwOnStdErr: false throughout
- Handles null/empty output safely1 parent 6bff35b commit 99021ae
1 file changed
+34
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
| 827 | + | |
827 | 828 | | |
828 | 829 | | |
829 | 830 | | |
830 | | - | |
831 | | - | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
832 | 864 | | |
833 | 865 | | |
834 | 866 | | |
| |||
0 commit comments