Function
compareIPAddr
(a *net.IPAddr, b *net.IPAddr)
Source from the content-addressed store, hash-verified
| 1031 | } |
| 1032 | |
| 1033 | func compareIPAddr(a *net.IPAddr, b *net.IPAddr) int { |
| 1034 | if a == b { |
| 1035 | return 0 |
| 1036 | } |
| 1037 | |
| 1038 | res := bytes.Compare(a.IP, b.IP) |
| 1039 | if res != 0 { |
| 1040 | return res |
| 1041 | } |
| 1042 | |
| 1043 | res = strings.Compare(a.Zone, b.Zone) |
| 1044 | if res != 0 { |
| 1045 | return res |
| 1046 | } |
| 1047 | |
| 1048 | return 0 |
| 1049 | } |
| 1050 | |
| 1051 | // Wrap the listener so that if it's closed in the serve loop it doesn't race with proxy Close() |
| 1052 | type closeOnceListener struct { |
Tested by
no test coverage detected