File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -34,14 +34,14 @@ func (c *Client) startPing() {
3434 pingHost .Range (func (k , v interface {}) bool {
3535 var lost * lostPacket
3636
37- host := k .(string )
37+ isp := k .(string )
3838 domain := v .(string )
3939
40- if host == "cm" {
40+ if isp == "cm" {
4141 lost = & CmLostPacket
42- } else if host == "cu" {
42+ } else if isp == "cu" {
4343 lost = & CuLostPacket
44- } else if host == "ct" {
44+ } else if isp == "ct" {
4545 lost = & CtLostPacket
4646 } else {
4747 return false
@@ -73,9 +73,15 @@ func (c *Client) startPing() {
7373 }
7474
7575 stat := pinger .Statistics ()
76+ if stat .AvgRtt == 0 {
77+
78+ lost .Push (true )
79+ c .pingTime .Store (isp , uint (time .Duration (0 )))
80+ return true
81+ }
7682
7783 lost .Push (false )
78- c .pingTime .Store (host , uint (stat .AvgRtt / time .Millisecond ))
84+ c .pingTime .Store (isp , uint (stat .AvgRtt / time .Millisecond ))
7985
8086 return true
8187 })
You can’t perform that action at this time.
0 commit comments