Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83fdbab3 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN
Browse files

Do not retry queries when socket remote hung up

When the remote hung up on the socket used to transmit DNS resolver
results, there is no point continuing to retry queries.

Detect whether the remote has hung up using poll with POLLHUP and do
not retry in that case.

This still sends the first query in any case to avoid the poll check and
minimize latency in the common case.

Closing the socket is what DnsResolver.java does via resNetworkCancel,
so this effectively implements the CancellationSignal in the DnsResolver
API.

Test: atest CtsNetTestCases:android.net.cts.DnsResolverCancellationTest
Change-Id: I4631dd97358e2ddaa7de7801b4188ac90185ead0
parent 2c32fa15
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment