Просмотр исходного кода

Log type of filtered-out ICE candidates

Rod Hynes 1 год назад
Родитель
Сommit
85b896f8ae
2 измененных файлов с 7 добавлено и 4 удалено
  1. 1 1
      psiphon/common/inproxy/sdp_test.go
  2. 6 3
      psiphon/common/inproxy/webrtc.go

+ 1 - 1
psiphon/common/inproxy/sdp_test.go

@@ -73,7 +73,7 @@ func runTestProcessSDP() error {
 
 		found := false
 		for _, reason := range metrics.filteredICECandidates {
-			if strings.Contains(reason, "disabled IPv6") {
+			if strings.Contains(reason, "disabled") {
 				found = true
 				break
 			}

+ 6 - 3
psiphon/common/inproxy/webrtc.go

@@ -1692,7 +1692,8 @@ func processSDPAddresses(
 				candidateIsIPv6 := false
 				if candidateIP.To4() == nil {
 					if disableIPv6Candidates {
-						reason := "disabled IPv6"
+						reason := fmt.Sprintf("disabled %s IPv6",
+							candidate.Type().String())
 						filteredCandidateReasons[reason] += 1
 						continue
 					}
@@ -1713,7 +1714,8 @@ func processSDPAddresses(
 					if candidateIsIPv6 {
 						version = "IPv6"
 					}
-					reason := fmt.Sprintf("bogon %s", version)
+					reason := fmt.Sprintf("bogon %s %s",
+						candidate.Type().String(), version)
 					filteredCandidateReasons[reason] += 1
 					continue
 				}
@@ -1747,7 +1749,8 @@ func processSDPAddresses(
 							version = "IPv6"
 						}
 						reason := fmt.Sprintf(
-							"unexpected GeoIP for %s candidate: %s/%s",
+							"unexpected GeoIP %s %s: %s/%s",
+							candidate.Type().String(),
 							version,
 							candidateGeoIPData.Country,
 							candidateGeoIPData.ASN)