Commit 8b4047d6 authored by Cecylia Bocovich's avatar Cecylia Bocovich 💬
Browse files

Only test remaining uncached bridge lines

This fixes a bug that occurs in requests that have both cached and
uncached bridge lines. In this case, we would serve the cached results
but then pass the unmodified TestRequest to Tor with both cached and
uncached bridges.
parent 7c4b4aad
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -113,11 +113,12 @@ func testBridgeLines(req *TestRequest) *TestResult {
			remainingBridgeLines = append(remainingBridgeLines, bridgeLine)
		}
	}
	req.BridgeLines = remainingBridgeLines

	// Test whatever bridges remain.
	if len(remainingBridgeLines) > 0 {
	if len(req.BridgeLines) > 0 {
		log.Printf("%d bridge lines served from cache; testing remaining %d bridge lines.",
			numCached, len(remainingBridgeLines))
			numCached, len(req.BridgeLines))

		start := time.Now()
		req.resultChan = make(chan *TestResult)